How do I pass data between activities in Android?
Add the following code in your current activity
1 2 3 4 5 6 |
<strong><code>Intent i = new Intent(getApplicationContext(), NewActivity.class); i.putExtra("new_variable_name","value"); startActivity(i);</code></strong> Then in the new Activity, retrieve those values: |
1 2 3 4 5 6 |
<strong><code>Bundle extras = getIntent().getExtras(); if (extras != null) { String value = extras.getString("new_variable_name"); } </code></strong> |
How to make notification intent resume rather than making a new intent?
Add the following code in your activity class
1 2 3 4 5 |
Intent intent= new Intent(context, YourActivity.class); intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_SINGLE_TOP); Change your Manifest by |
1 2 3 4 5 6 7 |
<activity android:name=".ResultActivity" ... <strong> android:launchMode="singleTask"</strong> ..... > </activity> |
1 |
Add SdCard in android emulator / Setup SDCard
1. Go to C:\[SDK dir]\android-sdk-windows\tools 2. Type mksdcard 512M mysdcard.iso and press enter. 3. your sdcard is succeesfully created. You may check with dir/w to see if the *.iso is created. 4. Now you have […]
Excel worksheet functions by category
Information functions: FUNCTION DESCRIPTION CELL Returns information about the formatting, location, or contents of a cell ERROR.TYPE Returns a number corresponding to an error type INFO Returns information about the […]