Go Back   Android Forums > Android Development > Application Development
Application Development Dev lounge for our application developers.

test: Reply
 
LinkBack Thread Tools
Old October 29th, 2012, 10:52 AM   #1 (permalink)
New Member
Thread Author (OP)
 
Join Date: Oct 2012
Location: Warsaw, Poland
Gender: Male
Posts: 6
 
Device(s): GT-i9100
Carrier: Not Provided

Thanks: 2
Thanked 0 Times in 0 Posts
Default Sending an intent from non-Activity extented class

I've two classes: MainActivity.java and CallReceiver.java . The problem is I can't send an intent from CallReceiver class. Eclipse throws an error: "The constructor error Intent(CallReceiver, Class<MainActivity>) is undefinied.

Code:
public class MainActivity extends Activity {
...
CallReceiver mCallReceiver = new CallReceiver(); 
// call my CallReceiver here
...
}
Code:
public class CallReceiver extends BroadcastReceiver  {
...
Intent intent = new Intent(CallReceiver.this, DisplayMessageActivity.class); 
// I'd like to send an intent from here to update MainAction.java view.
}

Advertisements
soulreaver1 is offline  
Reply With Quote
sponsored links
Reply


Go Back   Android Forums > Android Development > Application Development
Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT -5. The time now is 02:33 AM.
Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2014, vBulletin Solutions, Inc.