Java Code Examples for android.support.v4.content.ContextCompat.startActivity()

The following are Jave code examples for showing how to use startActivity() of the android.support.v4.content.ContextCompat class. You can vote up the examples you like. Your votes will be used in our system to get more good examples.
Example 1
Project: FastEc   File: PushReceiver.java   Source Code and License Vote up 5 votes
private void onOpenNotification(Context context, Bundle bundle) {
    final String extra = bundle.getString(JPushInterface.EXTRA_EXTRA);
    final Bundle openActivityBundle = new Bundle();
    final Intent intent = new Intent(context, ExampleActivity.class);
    intent.putExtras(openActivityBundle);
    intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_CLEAR_TOP);
    ContextCompat.startActivity(context, intent, null);
}
 
Example 2
Project: FastEc   File: Router.java   Source Code and License Vote up 5 votes
private void callPhone(Context context, String uri) {
    final Intent intent = new Intent(Intent.ACTION_DIAL);
    final Uri data = Uri.parse(uri);
    intent.setData(data);
    ContextCompat.startActivity(context, intent, null);
}
 
Example 3
Project: GitHub   File: SharedElementActivityActivity.java   Source Code and License Vote up 4 votes
public static void start(Context context) {
    Intent starter = new Intent(context, SharedElementActivityActivity.class);
    ContextCompat.startActivity(context, starter,
            ActivityOptionsCompat.makeSceneTransitionAnimation((Activity) context).toBundle());
}
 
Example 4
Project: GitHub   File: ActivityActivity.java   Source Code and License Vote up 4 votes
public static void start(Context context) {
    Intent starter = new Intent(context, ActivityActivity.class);
    ContextCompat.startActivity(context, starter,
            ActivityOptionsCompat.makeSceneTransitionAnimation((Activity) context).toBundle());
}