2016-03-18 7 views
1
public void onClick(View v) { 

final Intent intent=new Intent(Intent.ACTION_MAIN,null); 

intent.addCategory(Intent.CATEGORY_LAUNCHER); 

final ComponentName cn= new ComponentName("com.android.settings","com.android.settings.LOCALE_SETTINGS"); 

intent.setComponent(cn); 

intent.setFlags(intent.FLAG_ACTIVITY_NEW_TASK); 

startActivity(intent); 
      } 

答えて

0
button2.setOnClickListener(new OnClickListener() { 
    @Override 
    public void onClick(View v) { 
     // button 2 was clicked! 

startActivityForResult(new Intent(android.provider.Settings.ACTION_SETTINGS), 0); 
    } 
    }); 

このチュートリアルでは、代わりにACTION_SETTINGSの他の定数を使用したい場合は、Androidの公式ドキュメンテーションの外観を取る

http://weimenglee.blogspot.in/2013/06/android-tip-programmatically-displaying.html

参考にすることができます。 http://developer.android.com/reference/android/provider/Settings.html