我的安卓设置有问题。我想创建用于更改活动背景颜色的设置。我需要做什么?
我有布局:
public class MyApp extends PreferenceActivity{
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
}
public void display(View view)
{
Intent intent = new Intent(this, Display.class);
startActivity(intent);
}
@Override
public boolean onCreateOptionsMenu(Menu menu)
{
MenuInflater menuInflater = getMenuInflater();
menuInflater.inflate(R.menu.menu, menu);
return true;
}
public boolean onOptionsItemSelected( MenuItem item)
{
switch (item.getItemId())
{
case R.id.menu_about:
Intent menu_about = new Intent(this, About.class);
startActivity(menu_about);
return true;
case R.id.menu_copyright:
Intent menu_copyright = new Intent(this, Copyright.class);
startActivity(menu_copyright);
return true;
case R.id.menu_settings:
// ACTIVITY OF SETTINGS
return true;
case R.id.menu_exit:
finish();
return true;
default:
return super.onOptionsItemSelected(item);
}
};
}
我想要这样的偏好:
http://i.stack.imgur.com/k2qA5.png
现在,你明白我的意思了吗?