Click here to Skip to main content
14,362,953 members
   

Android

 
QuestionAre BroadcastReciever and ContentObserver killed If Started From Service? Pin
Django_Untaken27-Oct-19 20:15
memberDjango_Untaken27-Oct-19 20:15 
AnswerRe: Are BroadcastReciever and ContentObserver killed If Started From Service? Pin
Richard MacCutchan27-Oct-19 23:21
protectorRichard MacCutchan27-Oct-19 23:21 
QuestionDo you believe that Kotlin will become more popular than Java? Pin
Darina Smartym15-Oct-19 23:28
memberDarina Smartym15-Oct-19 23:28 
AnswerRe: Do you believe that Kotlin will become more popular than Java? Pin
Afzaal Ahmad Zeeshan28-Oct-19 2:02
mveAfzaal Ahmad Zeeshan28-Oct-19 2:02 
Questionattach .jar file to already running apk in emulator Pin
Member 1457084310-Oct-19 7:41
memberMember 1457084310-Oct-19 7:41 
AnswerRe: attach .jar file to already running apk in emulator Pin
Richard MacCutchan10-Oct-19 23:10
protectorRichard MacCutchan10-Oct-19 23:10 
GeneralRe: attach .jar file to already running apk in emulator Pin
Member 1457084311-Oct-19 1:11
memberMember 1457084311-Oct-19 1:11 
GeneralRe: attach .jar file to already running apk in emulator Pin
Richard MacCutchan11-Oct-19 1:53
protectorRichard MacCutchan11-Oct-19 1:53 
QuestionNullPointerException When Setting ClickListener on a RelativeLayout Pin
Django_Untaken12-Sep-19 1:52
memberDjango_Untaken12-Sep-19 1:52 
AnswerRe: NullPointerException When Setting ClickListener on a RelativeLayout Pin
Richard MacCutchan12-Sep-19 2:40
protectorRichard MacCutchan12-Sep-19 2:40 
GeneralRe: NullPointerException When Setting ClickListener on a RelativeLayout Pin
Django_Untaken12-Sep-19 2:44
memberDjango_Untaken12-Sep-19 2:44 
GeneralRe: NullPointerException When Setting ClickListener on a RelativeLayout Pin
Richard MacCutchan12-Sep-19 3:24
protectorRichard MacCutchan12-Sep-19 3:24 
SuggestionRe: NullPointerException When Setting ClickListener on a RelativeLayout Pin
David Crow12-Sep-19 10:22
memberDavid Crow12-Sep-19 10:22 
QuestionUnRegister BroadcastReceiver Dynamically While Exiting App throws IllegalArgumentException Pin
Django_Untaken12-Sep-19 1:16
memberDjango_Untaken12-Sep-19 1:16 
AnswerRe: UnRegister BroadcastReceiver Dynamically While Exiting App throws IllegalArgumentException Pin
Richard Deeming12-Sep-19 1:46
mveRichard Deeming12-Sep-19 1:46 
Does the exception say that the receiver is not registered?

At a guess, you're calling unregisterReceiver twice.

I don't "do" Android dev, but I suspect you'd want something more like this:
public void setOnHomePressedListener(OnHomePressedListener listener) {
    mListener = listener;
}

public void startWatch() {
    if (mListener != null && mReceiver == null) {
        mReceiver = new InnerReceiver();
        mContext.registerReceiver(mReceiver, mFilter);
    }
}

public void stopWatch() {
    if (mReceiver != null) {
        mContext.unregisterReceiver(mReceiver);
        mReceiver = null;
    }
}




"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer

QuestionHow to get a email from gmail to Wordpress? Pin
Member 1456898626-Aug-19 6:42
memberMember 1456898626-Aug-19 6:42 
AnswerRe: How to get a email from gmail to Wordpress? Pin
Richard Deeming27-Aug-19 4:09
mveRichard Deeming27-Aug-19 4:09 
AnswerRe: How to get a email from gmail to Wordpress? Pin
Leanbridge Technologies5-Nov-19 20:51
professionalLeanbridge Technologies5-Nov-19 20:51 
QuestionImage Transfer from Raspberry Pi (in Python) to Android app (Java) Pin
Member 1453729921-Jul-19 20:57
memberMember 1453729921-Jul-19 20:57 
AnswerRe: Image Transfer from Raspberry Pi (in Python) to Android app (Java) Pin
Richard MacCutchan21-Jul-19 22:29
protectorRichard MacCutchan21-Jul-19 22:29 
Questionpython Pin
Member 1453431518-Jul-19 0:25
memberMember 1453431518-Jul-19 0:25 
AnswerRe: python Pin
Richard MacCutchan18-Jul-19 1:37
protectorRichard MacCutchan18-Jul-19 1:37 
AnswerRe: python Pin
Afzaal Ahmad Zeeshan18-Jul-19 1:56
mveAfzaal Ahmad Zeeshan18-Jul-19 1:56 
QuestionQR camera scan with android phone using C# Pin
A.Shoman15-Jul-19 22:04
memberA.Shoman15-Jul-19 22:04 
AnswerRe: QR camera scan with android phone using C# Pin
Richard MacCutchan15-Jul-19 22:15
protectorRichard MacCutchan15-Jul-19 22:15 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.