3

如何调用插件中的函数或从广播接收器初始化插件?

public void onReceive(Context context, Intent intent) {
   try {
      int st = intent.getIntExtra("state", -1);
      if (intent.getAction().equals(Intent.ACTION_HEADSET_PLUG)) {                      
         if(st==1)
         {
             //call from here
         }                      
      }
   } catch (Exception e) {
      e.printStackTrace();
   }
}
4

0 回答 0