USSD service not working

后端 未结 4 2046
渐次进展
渐次进展 2020-12-08 11:19

I\'m trying to develop an application which silently dismiss the USSD responses. I\'ve used the code from http://commandus.com/blog/?p=58 with minor changes. I\'ve created t

4条回答
  •  北海茫月
    2020-12-08 11:46

    Have you declared your broadcast receiver in your manifest file?

    add inside your manifest:

    
                
                    
                
            
    
    
    

    in BootReceiver.java :

        public void onReceive(Context context, Intent intent) {
    
            context.startService(new Intent(context,ExtendedNetworkService.class));
    }
    

    in ExtendedNetworkService.java :

    public class ExtendedNetworkService extends Service {
    
        IExtendedNetworkService.Stub binder = new IExtendedNetworkService.Stub() {
    
            public void setMmiString(String number) throws RemoteException {}
            public CharSequence getMmiRunningText() throws RemoteException {
    
                return null;
            }
            public CharSequence getUserMessage(CharSequence text)
                    throws RemoteException {
    
                Log.d(Constants.TAG, "Message : " + text);
                Log.d(Constants.TAG, "getMmiRunningTest() : " + getMmiRunningText());
                    return null;
            }
            public void clearMmiString() throws RemoteException {
            }
    
        };
    
            return false;
        }
    
        public void onCreate() {
    
            Log.d(Constants.TAG, "ExtendedNetworkService Started..");
    
            super.onCreate();
        }
    
    public IBinder onBind(Intent arg0) {
    
            Log.d(Constants.TAG, "ExtendedNetworkService got binded...");
    
            return binder;
    
        }
    
    }
    

提交回复
热议问题