i making custom keyboard app.
there button leads user app input method settings
.
here intent:
startactivityforresult(new intent(settings.action_input_method_settings), 2000);
now, there way return user activity after enables keyboard?
edit
there way set broadcastreceiver , register when user clicks "ok" button on warning window? , app can call super.onresume() resume activity.
so spawn intentservice listens changes @ same time launch settings menu. believe how swiftkey has done theirs.
public class myservice extends intentservice { /** * creates intentservice */ public myservice() { super("myservice"); } @override protected void onhandleintent(intent intent) { string packagelocal = getpackagename(); boolean isinputdeviceenabled = false; while(!isinputdeviceenabled) { inputmethodmanager inputmethodmanager = (inputmethodmanager) getsystemservice(input_method_service); list<inputmethodinfo> list = inputmethodmanager.getenabledinputmethodlist(); // check if our keyboard enabled input method for(inputmethodinfo inputmethod : list) { string packagename = inputmethod.getpackagename(); if(packagename.equals(packagelocal)) { isinputdeviceenabled = true; } } } // open activity intent newintent = new intent(this, mainactivity.class); newintent.addflags(intent.flag_activity_new_task); startactivity(newintent); } }
Comments
Post a Comment