“No Activity found to handle Intent” while emailing data

前端 未结 5 1046
深忆病人
深忆病人 2020-12-30 23:07

I am trying to mail data using this code:

email = (Button) findViewById(R.id.enail);
    email.setOnClickListener(new View.OnClickListener() {

        publi         


        
5条回答
  •  心在旅途
    2020-12-30 23:38

    I tested this on my device, and the code works perfectly. And I testet this code on an emulator, too, and it crashed. The problem is that the OS didn't find any activities which can handle this ACTION_SEND. Surround this kind of code all the time with a try/catch, since you can not be sure if there exists such an activity that can handle your intent. And try to install at least one app that can handle the ACTION_SEND, then try again, and see if it works for you.

提交回复
热议问题