EDIT: हल करने के बाद भी एंड्रॉइड कीबोर्ड अभी भी दिखाई देता है। उत्तरईमेल उद्देश्य
मैं अंतर्निहित Intent.ACTION_SEND "chooser" लॉन्च कर रहा हूं ताकि उपयोगकर्ता मेरे एप्लिकेशन से संदेश कैसे भेज सकता है। यह ठीक काम करता है, लेकिन अगर मैंने लॉन्च किए गए ईमेल प्रोग्राम में 'डिस्कार्ड' मारा है, तो यह मेरे एप्लिकेशन पर ऑन-स्क्रीन कीबोर्ड के साथ अभी भी दिखाई देता है। मैंने imm.hideSoftInputFromWindow (...) के विभिन्न incantations के साथ इसे बंद करने की कोशिश की है, लेकिन कोई फायदा नहीं हुआ। इसे ठीक करने का कोई तरीका?
इस प्रकार मैं 'chooser' लॉन्च कर रहा हूं और कीबोर्ड सक्रियता() पर कीबोर्ड बंद करने का प्रयास कर रहा हूं। ध्यान दें कि tabHost मेरे मुख्य एप्लिकेशन (MainApp) में एक स्थिर सदस्य है जिसमें tabSpecs बनाने के लिए उपयोग की जाने वाली टैबहोस्ट ऑब्जेक्ट होता है। मेल // एड के इरादे कॉल करने से पहले इस कोड
public class L_Secondary extends ListActivity implements myConst
{
@Override
protected void onCreate (Bundle savedInstanceState)
{
super.onCreate (savedInstanceState);
setContentView(R.layout.l_people_secondary);
// instantiate the custom array adapter class and pass it some info to build a ListView with.
ListView lv = getListView();
lv.setOnItemClickListener (oicl);
A_secondary da = new A_secondary (this, android.R.layout.simple_list_item_single_choice, mPiecesArray, mPartsArray);
setListAdapter (da);
}
...
// after launching the email client, the keyboard stays visible
// over the Listview. Currently the keyboard gets forced to close
// in getView() of the ArrayAdapter class da, in onCreate() above
public void launchEmail()
{
try
{
// use the builtin chooser for users mail app
Intent sendIntent = new Intent(Intent.ACTION_SEND, Uri.fromParts ("mailto", "[email protected]", null));
sendIntent.setType("text/plain");
sendIntent.putExtra(android.content.Intent.EXTRA_SUBJECT, "msg_subject");
sendIntent.putExtra(android.content.Intent.EXTRA_TEXT, "msg_body");
startActivityForResult (Intent.createChooser(sendIntent, "Send via which Application?"), 0);
}
catch (Exception e)
{
Toast.makeText (this, "No activity was found to handle this action",Toast.LENGTH_SHORT).show();
}
}
...
}
यह क्यों काम कर रहा है?मुझे अपनी स्थिति में इसका इस्तेमाल करने की कोशिश करने के लिए समझने की जरूरत है। – Poutrathor