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

Android examples for Intent:Open App

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 {
  /**// w  w w .  j  a  va2s.com
   * 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