Java Code Examples for android.support.v4.app.FragmentActivity#startActivity()

The following examples show how to use android.support.v4.app.FragmentActivity#startActivity() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: StartupHandler.java    From citra_android with GNU General Public License v3.0 6 votes vote down vote up
public static void HandleInit(FragmentActivity parent)
{
  // Ask the user to grant write permission if it's not already granted
  PermissionsHandler.checkWritePermission(parent);

  String start_file = "";
  Bundle extras = parent.getIntent().getExtras();
  if (extras != null)
    start_file = extras.getString("AutoStartFile");

  if (!TextUtils.isEmpty(start_file))
  {
    // Start the emulation activity, send the ISO passed in and finish the main activity
    Intent emulation_intent = new Intent(parent, EmulationActivity.class);
    emulation_intent.putExtra("SelectedGame", start_file);
    parent.startActivity(emulation_intent);
    parent.finish();
  }
}
 
Example 2
Source File: SongMenuHelper.java    From RetroMusicPlayer with GNU General Public License v3.0 5 votes vote down vote up
public static boolean handleMenuClick(@NonNull FragmentActivity activity, @NonNull Song song, int menuItemId) {
    switch (menuItemId) {
        case R.id.action_set_as_ringtone:
            MusicUtil.setRingtone(activity, song.id);
            return true;
        case R.id.action_share:
            activity.startActivity(Intent.createChooser(MusicUtil.createShareSongFileIntent(song, activity), null));
            return true;
        case R.id.action_delete_from_device:
            DeleteSongsDialog.create(song).show(activity.getSupportFragmentManager(), "DELETE_SONGS");
            return true;
        case R.id.action_add_to_playlist:
            AddToPlaylistDialog.create(song).show(activity.getSupportFragmentManager(), "ADD_PLAYLIST");
            return true;
        case R.id.action_play_next:
            MusicPlayerRemote.playNext(song);
            return true;
        case R.id.action_add_to_current_playing:
            MusicPlayerRemote.enqueue(song);
            return true;
        case R.id.action_tag_editor:
            Intent tagEditorIntent = new Intent(activity, SongTagEditorActivity.class);
            tagEditorIntent.putExtra(AbsTagEditorActivity.EXTRA_ID, song.id);
            if (activity instanceof PaletteColorHolder)
                tagEditorIntent.putExtra(AbsTagEditorActivity.EXTRA_PALETTE, ((PaletteColorHolder) activity).getPaletteColor());
            activity.startActivity(tagEditorIntent);
            return true;
        case R.id.action_details:
            SongDetailDialog.create(song).show(activity.getSupportFragmentManager(), "SONG_DETAILS");
            return true;
        case R.id.action_go_to_album:
            NavigationUtil.goToAlbum(activity, song.albumId);
            return true;
        case R.id.action_go_to_artist:
            NavigationUtil.goToArtist(activity, song.artistId);
            return true;
    }
    return false;
}
 
Example 3
Source File: ChangeActivityHelper.java    From AwesomeSplash with MIT License 5 votes vote down vote up
public static void changeActivity(FragmentActivity source, Class<?> destination, boolean shouldFinishContext, Bundle bundle) {
    if (shouldFinishContext){
        source.finish();
    }
    Intent intent = new Intent(source, destination);
    intent.putExtras(bundle);
    source.startActivity(intent);
}
 
Example 4
Source File: VideoOutputActivity.java    From SimpleVideoEdit with Apache License 2.0 4 votes vote down vote up
public static void go(FragmentActivity from){
    Intent intent = new Intent(from,VideoOutputActivity.class);
    from.startActivity(intent);
}
 
Example 5
Source File: SongMenuHelper.java    From Orin with GNU General Public License v3.0 4 votes vote down vote up
public static boolean handleMenuClick(@NonNull FragmentActivity activity, @NonNull Song song, int menuItemId) {
    switch (menuItemId) {
        case R.id.action_set_as_ringtone:
            MusicUtil.setRingtone(activity, song.id);
            return true;
        case R.id.action_share:
            activity.startActivity(Intent.createChooser(MusicUtil.createShareSongFileIntent(song), null));
            return true;
        case R.id.action_delete_from_device:
            DeleteSongsDialog.create(song).show(activity.getSupportFragmentManager(), "DELETE_SONGS");
            return true;
        case R.id.action_add_to_playlist:
            AddToPlaylistDialog.create(song).show(activity.getSupportFragmentManager(), "ADD_PLAYLIST");
            return true;
        case R.id.action_play_next:
            MusicPlayerRemote.playNext(song);
            return true;
        case R.id.action_add_to_current_playing:
            MusicPlayerRemote.enqueue(song);
            return true;
        case R.id.action_tag_editor:
            Intent tagEditorIntent = new Intent(activity, SongTagEditorActivity.class);
            tagEditorIntent.putExtra(AbsTagEditorActivity.EXTRA_ID, song.id);
            if (activity instanceof PaletteColorHolder)
                tagEditorIntent.putExtra(AbsTagEditorActivity.EXTRA_PALETTE, ((PaletteColorHolder) activity).getPaletteColor());
            activity.startActivity(tagEditorIntent);
            return true;
        case R.id.action_details:
            SongDetailDialog.create(song).show(activity.getSupportFragmentManager(), "SONG_DETAILS");
            return true;
        case R.id.action_go_to_album:
            NavigationUtil.goToAlbum(activity, song.albumId);
            return true;
        case R.id.action_go_to_artist:
            NavigationUtil.goToArtist(activity, song.artistId);
            return true;
    }
    return false;
}
 
Example 6
Source File: JumpChatUtils.java    From BigApp_Discuz_Android with Apache License 2.0 4 votes vote down vote up
/**
 * 发起聊天
 * @param context
 */
public static void gotoChat(FragmentActivity context,Mypm mypm) {
    Intent intent = getChatIntent(context,mypm);
    context.startActivity(intent);
}
 
Example 7
Source File: Navigator.java    From outlay with Apache License 2.0 4 votes vote down vote up
public static void goToMainScreen(FragmentActivity activityFrom) {
    Intent intent = new Intent(activityFrom, MainActivity.class);
    intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP | Intent.FLAG_ACTIVITY_NEW_TASK);
    activityFrom.startActivity(intent);
}
 
Example 8
Source File: Navigator.java    From outlay with Apache License 2.0 4 votes vote down vote up
public static void goToLoginScreen(FragmentActivity activityFrom) {
    Intent intent = new Intent(activityFrom, LoginActivity.class);
    activityFrom.startActivity(intent);
}
 
Example 9
Source File: Navigator.java    From outlay with Apache License 2.0 4 votes vote down vote up
public static void goToSyncGuestActivity(FragmentActivity activityFrom) {
    Intent intent = new Intent(activityFrom, SyncGuestActivity.class);
    activityFrom.startActivity(intent);
}
 
Example 10
Source File: InfoFragment.java    From chromeadb_for_android with BSD 2-Clause "Simplified" License 4 votes vote down vote up
private void showOssLicenses() {
    FragmentActivity activity = getActivity();
    Intent intent = new Intent(activity, OssLicenseActivity.class);
    activity.startActivity(intent);
}