Returns an intent for launching the application settings for the app with the specified activity. - Android Activity

Android examples for Activity:Activity Feature

Description

Returns an intent for launching the application settings for the app with the specified activity.

Demo Code

import android.content.Context;
import android.content.Intent;
import android.net.Uri;
import android.support.annotation.NonNull;

public class Main {
  /**/*  www.  j  a  v a 2 s .  c  o m*/
   * Returns an intent for launching the application settings for the app with
   * the specified activity.
   *
   * @param context
   *          Context instance
   * @return Intent object.
   */
  public static Intent getApplicationSettingsIntent(@NonNull Context context) {
    Intent intent = new Intent(
        android.provider.Settings.ACTION_APPLICATION_DETAILS_SETTINGS);
    intent.setData(Uri.parse("package:" + context.getPackageName()));

    return intent;
  }
}

Related Tutorials