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

Android examples for android.app:Activity

Description

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

Demo Code

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

public class Main {

  /**/*from  w w w .ja  v  a  2s.  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