android-activity
Android – start multiple activities
You might need something like this in order to launch deep into the app after the user has clicked a notification in order to display some newly added content, for example. Intent i = new Intent(this, A.class); i.setFlags(Intent.FLAG_ACTIVITY_NO_ANIMATION); startActivity(i); Intent j = new Intent(this, B.class); j.setFlags(Intent.FLAG_ACTIVITY_NO_ANIMATION); startActivity(j); Intent k = new Intent(this, C.class); startActivity(k); In …
What is the different between Explicit and implicit activity call in android?
For example: implicit activity call In intent filter you create action for you activity, so other app can call your activity via this action as following: <activity android:name=”.BrowserActivitiy” android:label=”@string/app_name”> <intent-filter> <action android:name=”android.intent.action.VIEW” /> <category android:name=”android.intent.category.DEFAULT” /> <data android:scheme=”http”/> </intent-filter> </activity> And the other way to call implicit Intent is below: Intent intent = new Intent(Intent.ACTION_VIEW, …
Calling a Activity method from BroadcastReceiver in Android
try this code : your broadcastreceiver class for internet lost class : public class InternetLostReceiver extends BroadcastReceiver{ @Override public void onReceive(Context context, Intent intent) { context.sendBroadcast(new Intent(“INTERNET_LOST”)); } } in your activity add this for calling broadcast: public class TestActivity extends Activity{ @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); registerReceiver(broadcastReceiver, new IntentFilter(“INTERNET_LOST”)); } BroadcastReceiver …
How to know the calling activity in Android
If you start the activity with startActivityForResult(Intent, int), then you can get calling activity by getCallingActivity().getClassName().