我想篩選任務以顯示用戶在複選框中選擇的內容,但是當我運行此代碼時出現錯誤。 這是過濾器活動中的功能如何篩選活動中的listView
enter code here
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_filter);
INITIALIZE();
DONE();
}
public void INITIALIZE()
{
Go=(Button)findViewById(R.id.go);
ProH=(CheckBox)findViewById(R.id.pro1);
ProM=(CheckBox)findViewById(R.id.pro2);
ProL=(CheckBox)findViewById(R.id.pro3);
Finished=(CheckBox)findViewById(R.id.finished);
NotFinished=(CheckBox)findViewById(R.id.notfinished);
Past=(CheckBox)findViewById(R.id.past);
Future=(CheckBox)findViewById(R.id.future);
}
public void DONE()
{
final AlertDialog.Builder alertbox = new AlertDialog.Builder(this);
Go.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View arg0) {
// TODO Auto-generated method stub
if((proH==1&&proM==1)||(proM==1&&proL==1)||(proH==1&&proL==1))
{
alertbox.setTitle("Error!");
alertbox.setMessage("Please Choose one Priority");
alertbox.setNeutralButton("ok",new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
// TODO Auto-generated method stub
}
});
alertbox.show();
ProH.setChecked(false);
ProM.setChecked(false);
ProL.setChecked(false);
}
}
});}}
這是什麼錯誤?
你應該分享你看到的錯誤。 logcat說什麼? – Matt
01-24 21:51:33.931:E/AndroidRuntime(309):致命例外:main 01-24 21:51:33.931:E/AndroidRuntime(309):android.content.ActivityNotFoundException:找不到處理Intent的活動{act = com.example.todolist.FILTER} 01-24 21:51:33.931:E/AndroidRuntime(309):\t at android.app.Instrumentation.checkStartActivityResult(Instrumentation.java:1408) 01-24 21: 51:33.931:E/AndroidRuntime(309):\t at android.app.Instrumentation.execStartActivity(Instrumentation.java:1378) 01-24 21:51:33.931:E/AndroidRuntime(309):\t at android.app。 Activity.startActivityForResult(Activity.java:2817) – user3190285
這是錯誤的一部分,但是當我點擊l主要活動中的過濾按鈕來打開這個活動時,它就退出 – user3190285