Click here to Skip to main content
14,663,203 members
Home » Discussions » Android
   

Android

 
QuestionFetching JSON data in recyclerview using retrofit and implement scroll to load or infinitescroll Pin
Arindam Mukherjee20-Jun-18 19:29
MemberArindam Mukherjee20-Jun-18 19:29 
QuestionCurrent Android Studio // Is it 2017 ? Pin
C-P-User-313-Jun-18 22:41
MemberC-P-User-313-Jun-18 22:41 
AnswerRe: Current Android Studio // Is it 2017 ? Pin
Richard Deeming14-Jun-18 2:36
mveRichard Deeming14-Jun-18 2:36 
AnswerRe: Current Android Studio // Is it 2017 ? Pin
Ganza Charles20-Jun-18 22:42
MemberGanza Charles20-Jun-18 22:42 
GeneralRe: Current Android Studio // Is it 2017 ? Pin
C-P-User-311-Nov-18 20:46
MemberC-P-User-311-Nov-18 20:46 
Question(ANDROID) -->How can data be send from the run method of a thread in a service to a client using Handler and Messeger? Pin
Member 119110659-Jun-18 22:36
MemberMember 119110659-Jun-18 22:36 
AnswerRe: (ANDROID) -->How can data be send from the run method of a thread in a service to a client using Handler and Messeger? Pin
Richard MacCutchan10-Jun-18 4:18
mveRichard MacCutchan10-Jun-18 4:18 
GeneralRe: (ANDROID) -->How can data be send from the run method of a thread in a service to a client using Handler and Messeger? Pin
Member 1191106510-Jun-18 9:24
MemberMember 1191106510-Jun-18 9:24 
Dear mr. MacCutchan Thank you very much for your answer, and yes your guess is correct Iam getting the exception on this line
msg.replyTo.send(message);



I am a novice on Android programming and I tried to debug the program. This is what I get from the debugger

this = {RuntimeInit$UncaughtHandler@4000} 
t = {Thread@3564} "Thread[main,5,main]"
e = {NullPointerException@4001} "java.lang.NullPointerException: Attempt to invoke virtual method 'void android.os.Messenger.send(android.os.Message)' on a null object reference"
 cause = {NullPointerException@4001} "java.lang.NullPointerException: Attempt to invoke virtual method 'void android.os.Messenger.send(android.os.Message)' on a null object reference"
 detailMessage = "Attempt to invoke virtual method 'void android.os.Messenger.send(android.os.Message)' on a null object reference"
 stackState = {Object[9]@4006} 
 stackTrace = {StackTraceElement[0]@4007} 
 suppressedExceptions = {Collections$EmptyList@4008}  size = 0
 shadow$_klass_ = {Class@2610} "class java.lang.NullPointerException"
 shadow$_monitor_ = -2090121786



Quote:
I've also tried to specify the handler directly like so:



Quote:

msg.replyTo = new Messenger(new ServiceHandler());
serviceMessenger.send(msg);


Quote:
but I'm getting another exception on line serviceMessenger.send(msn);



java.lang.IllegalStateException: { when=0 what=1 target=com.seber.lisah.BluetoothService$ServiceHandler } This message is already in use.

GeneralRe: (ANDROID) -->How can data be send from the run method of a thread in a service to a client using Handler and Messeger? Pin
Richard MacCutchan10-Jun-18 22:06
mveRichard MacCutchan10-Jun-18 22:06 
SuggestionRe: (ANDROID) -->How can data be send from the run method of a thread in a service to a client using Handler and Messeger? Pin
David Crow11-Jun-18 2:16
MemberDavid Crow11-Jun-18 2:16 
QuestionAddition,Sub,Mul & divide issue Pin
Member 1126111131-May-18 2:22
MemberMember 1126111131-May-18 2:22 
AnswerRe: Addition,Sub,Mul & divide issue Pin
Richard MacCutchan2-Jun-18 2:44
mveRichard MacCutchan2-Jun-18 2:44 
QuestionXamarin WebView please help. Pin
Member 1335044424-May-18 6:03
MemberMember 1335044424-May-18 6:03 
AnswerRe: Xamarin WebView please help. Pin
David Crow24-May-18 9:34
MemberDavid Crow24-May-18 9:34 
GeneralRe: Xamarin WebView please help. Pin
Member 1335044425-May-18 11:07
MemberMember 1335044425-May-18 11:07 
QuestionRe: Xamarin WebView please help. Pin
David Crow28-May-18 15:59
MemberDavid Crow28-May-18 15:59 
QuestionAndroid code obfuscating Pin
AndroidVH21-May-18 23:14
MemberAndroidVH21-May-18 23:14 
SuggestionRe: Android code obfuscating Pin
Jochen Arndt21-May-18 23:54
professionalJochen Arndt21-May-18 23:54 
GeneralRe: Android code obfuscating Pin
AndroidVH22-May-18 2:23
MemberAndroidVH22-May-18 2:23 
GeneralRe: Android code obfuscating Pin
Jochen Arndt22-May-18 2:53
professionalJochen Arndt22-May-18 2:53 
GeneralRe: Android code obfuscating Pin
AndroidVH22-May-18 18:18
MemberAndroidVH22-May-18 18:18 
AnswerRe: Android code obfuscating Pin
David Crow22-May-18 2:28
MemberDavid Crow22-May-18 2:28 
Questionhow to append new elements in to an array list in android? Pin
rathilesh c20-May-18 0:10
Memberrathilesh c20-May-18 0:10 
QuestionRe: how to append new elements in to an array list in android? Pin
Richard MacCutchan20-May-18 1:23
mveRichard MacCutchan20-May-18 1:23 
AnswerRe: how to append new elements in to an array list in android? Pin
rathilesh c20-May-18 2:04
Memberrathilesh c20-May-18 2:04 

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.