b | = |
|
a = Math.sqrt(s + 2 * Math.pow(t, 3 * n) b = (2 * s * Math.pow(3 * n)) / (1 - 5 * Math(u + 2, 2 * n))
HashMap<String, Integer> map = new HashMap<String, Integer>( )How do you add an Integer object to the collection? How do you retrieve the Integer object stored using the key "K123"? We will use a similar concept when we store information from an activity in the storedInstanceState object. Ans:
// Put the value 35 into the Hashmap using the key "C123". map.put("C123", 35); // Retrieve the value stored at the key "C123" from the hashmap. int n = String.valueOf(map.get("C123"));
android:textAllCaps="false"
EditText editText1 = (EditText) findViewById(R.id.edittext1); String s = editText1.getText( ).toString( );
Event | Event Handler | Description | Required |
---|---|---|---|
ON_CREATE | onCreate | Fires immediately after the activity is first created. | Yes |
ON_START | onStart | Fires immediately after the activity becomes visible. It prepares the activity to move into the foreground and become interactive. | No |
ON_RESUME | onResume | Fires when the activity moves into the foreground after going into the background. | No |
ON_RESTART | onRestart | Fires when a covered activity moves into the foreground after being stopped, but not destroyed. | No |
ON_PAUSE | onPause | Fires immediately before the activity moves into the background. It may still be visible. | No |
ON_STOP | onStop | Fires when the activity has finished running and is no longer visible to the user, but may still be in memory. | No |
ON_DESTROY | onDestroy | Fires immediately before an app has terminated and is about to be unloaded from memory. | No |