Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Android service not showing logs?

Tags:

android

I am a bit confused,

it seems that my Service does not print logs,

the service starts regularly (I can debug it), I see all other logs,

but from the service no logs.

Please what am I missing here?

@Override
protected void onHandleIntent(Intent intent) {
    Log.e("TAG","Downlaoding devices list");//This should log something!
like image 888
Lisa Anne Avatar asked Feb 09 '23 01:02

Lisa Anne


2 Answers

Chances are your IntentService is not getting called. try using the whole package name of the IntentService. I've seen this somewhere I'll post a link if I find it. Something like this...

Intent intent = new Intent(this/*Context*/,com.myapp.MyIntentService.class); //as opposed to // new Intent(this, MyIntentService.class); startService(intent);

Edit: I found the link. intentService : why my onHandleIntent is never called?

like image 88
Sybregunne Avatar answered Feb 11 '23 15:02

Sybregunne


In Android Studio Logcat. Before running your code, 1) Select No Filters instead of Show selected applications 2) In the search box, type in your tag. 3) Now Run your code and all your logs will be displayed.

Note: It won't work if you enter your tag after running your code.

like image 33
anto004 Avatar answered Feb 11 '23 14:02

anto004