how to use intent from receiver android -


I have a working SMS receiver, but when I try to load another class:

P>

  intended intent = new intent (SMSReceiver.This, SMSNotifier.class); StartActivityForResult (intent, 0);  

I get this error:

Constructor intent (SMS receiver, class) is undefined

before For line and:

method startActivityForResult (intestine, int) for the second line type is SMSReceiver

I Really appreciate some advice about what is going wrong.

  package com.prototype.messages; Import android.app.Notification; Import android.app.NotificationManager; Import android.app.PendingIntent; Import android.content.BroadcastReceiver; Import android.content.Context; Import android.content.Intent; Importroid.os.Bundle; Import android.telephony.gsm.SmsMessage; & Gt; Public class SMSReceiver expands Broadcast receiver {@ Override available on public blank (reference reference, intended intent) {bundle bundle = intent. SMS Message [] msgs = Null; String str = ""; If (bundle! = Null) {object [] pdus = (object []) bundle.get ("puds"); Msgs = New SMS Message [pdus.length]; For (int i = 0; i  

SMS receiver is not an activity only Only can be used to create startActivityForResult () , and only Contexts ( activity a parent Class) using the code> constructor you choose.


Comments

Popular posts from this blog

windows - Heroku throws SQLITE3 Read only exception -

lex - Building a lexical Analyzer in Java -

python - rename keys in a dictionary -