Failure delivering result ResultInfo

前端 未结 2 1617
慢半拍i
慢半拍i 2021-01-17 08:09

There are many people who have encountered the same error on stackoverflow, but I haven\'t been able to find any relevant resolution in those posts. My MainActivity is start

2条回答
  •  野的像风
    2021-01-17 08:52

    Try this-

    protected void onActivityResult(int requestCode, int resultCode, Intent data) 
    {
          if (requestCode == 1 && data != null) 
          {
             Log.v("TAG", data.getStringExtra("Note"));
             if(resultCode == RESULT_OK)
             {        
                 listItems.add(data.getStringExtra("Note"));
                 Log.v("TAG", data.getStringExtra("Note"));
                 adapter.notifyDataSetChanged();
                 listView.invalidateViews();
             }
             if (resultCode == RESULT_CANCELED) 
             {   
    
             }
          }
    }
    

提交回复
热议问题