android页面跳转到空白页???
这是部分代码TaskMangerActivity.java:publicvoidenterSetting(Viewview){Intentintent=newIntent...
这是部分代码
TaskMangerActivity.java:
public void enterSetting(View view){
Intent intent = new Intent(this,TaskSettingActivity.class);
startActivity(intent);
//startActivityForResult(intent, 0);
}
protected void onActivityResult(int requestCode, int resultCode,Intent data) {
adapter.notifyDataSetChanged();
super.onActivityResult(requestCode, resultCode, data);
}
TaskSettingActivity.java:
package com.example.android_demo2;
import android.app.Activity;
import android.content.SharedPreferences;
import android.content.SharedPreferences.Editor;
import android.graphics.Bitmap.Config;
import android.graphics.Shader;
import android.os.Bundle;
import android.text.Editable;
import android.widget.CheckBox;
import android.widget.CompoundButton;
import android.widget.CompoundButton.OnCheckedChangeListener;
public class TaskSettingActivity extends Activity {
private CheckBox cb_show_system;
private SharedPreferences sp;
protected void onCreat(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_task_setting);
sp = getSharedPreferences("Config", MODE_PRIVATE);
cb_show_system = (CheckBox) findViewById(R.id.cb_show_system);
cb_show_system.setChecked(sp.getBoolean("showsystem", false));
cb_show_system.setOnCheckedChangeListener(new OnCheckedChangeListener() {
@Override
public void onCheckedChanged(CompoundButton buttonView, boolean isCheked) {
Editor editor = sp.edit();
editor.putBoolean("showsystem", isCheked);
editor.commit();
}
});
}
}
为什么跳转之后就成了空白页呢 展开
TaskMangerActivity.java:
public void enterSetting(View view){
Intent intent = new Intent(this,TaskSettingActivity.class);
startActivity(intent);
//startActivityForResult(intent, 0);
}
protected void onActivityResult(int requestCode, int resultCode,Intent data) {
adapter.notifyDataSetChanged();
super.onActivityResult(requestCode, resultCode, data);
}
TaskSettingActivity.java:
package com.example.android_demo2;
import android.app.Activity;
import android.content.SharedPreferences;
import android.content.SharedPreferences.Editor;
import android.graphics.Bitmap.Config;
import android.graphics.Shader;
import android.os.Bundle;
import android.text.Editable;
import android.widget.CheckBox;
import android.widget.CompoundButton;
import android.widget.CompoundButton.OnCheckedChangeListener;
public class TaskSettingActivity extends Activity {
private CheckBox cb_show_system;
private SharedPreferences sp;
protected void onCreat(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_task_setting);
sp = getSharedPreferences("Config", MODE_PRIVATE);
cb_show_system = (CheckBox) findViewById(R.id.cb_show_system);
cb_show_system.setChecked(sp.getBoolean("showsystem", false));
cb_show_system.setOnCheckedChangeListener(new OnCheckedChangeListener() {
@Override
public void onCheckedChanged(CompoundButton buttonView, boolean isCheked) {
Editor editor = sp.edit();
editor.putBoolean("showsystem", isCheked);
editor.commit();
}
});
}
}
为什么跳转之后就成了空白页呢 展开
1个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询