Android :: Starting Service From Other Apk - Throws NoClassDefFoundError Exception

Jul 31, 2010

I have two projects in Eclipse: service and UI client.

In onCreate in UI client I have:startService(new Intent(this, ExampleService.class));

But this fragment: ExampleService.class throws NoClassDefFoundError exception at runtime. I have installed ExampleService.apk, and ExampleUiClient.apk. Project compiles, and everything looks fine. What I am doing wrong?

Is it possible to start service from other apk?

Android :: Starting service from other apk - throws NoClassDefFoundError exception

Android :: IsUserAMonkey Throws Exception

Oct 17, 2010


I get the following exception when trying to use the isUserAMonkey API on a keydown. mAM = (; if (mAM.isUserAMonkey()) {return true;} Any reason why this may be happening?

View 9 Replies View Related

Android :: ProgressDialog In AsyncTask Throws An Exception

Jun 25, 2010

I'm trying to make a simple ProgressDialog appear while my AsyncTask is fetching data. In my onPreExecute() method I have this: pd =, "Loading...", "Please wait");

c is the context passed into the constructor of my AsyncTask from this.getApplicationContext(). Unfortunately, I keep getting an exception with this message: Unable to add window -- Token null is not for an application

What am I doing wrong?

Using this instead of this.getApplicationContext() has revealed another problem. When I call, a ProgressDialog is displayed, but not until after the AsyncTask has completed. In other words, the data loads and then the dialog is displayed. If I include pd.dismiss() in my onPostExecute() then I never even see the dialog (presumable because it is closed before it ever gets opened).

It turns out that fetch.get() was hogging the UI thread and not letting the ProgressDialog display.

View 2 Replies View Related

Android :: Calling NotifyDataSetChanged() Throws Exception

Oct 7, 2010

I have a ListView that I'm binding to an adapter. The adapter is a protected member of my main class. I have a listener thread that receives data and updates the source list for my adapter. When I call the adapter's notifyDataSetChanged() method, an exception is thrown:

Runtime Exception: PhoneLayoutInflater(LayoutInflater).inflate(int, ViewGroup, boolean) line: 322

I've read that the notifyDataSetChanged() method has to be called on the UI thread, and I'm doing that. In fact, just to be sure, I even update the ListView's data source on the UI thread. All I do in my listener thread is update a protected member that houses the data. Here's an example of what I'm doing (note that I don't have the part of the code that calls the AsyncTask, but it's fired from a listener):


Does anyone have any pointers or ideas as to why I'm getting this exception? Any help is much appreciated.

Here are the layout files, as requested:





View 1 Replies View Related

Android :: PreferenceScreen - Intent - Element Throws Exception

Sep 17, 2010

I've got a probleme with an exception, but I don't know why I get this exception.

The project is about implementing an AbstractAccountAuthenticator with an AbstractThreadedSyncAdapter to sync certain data on a server with a content provider.

I made everything and both adding accounts and syncing is running without any problems.

Now I've tried to add a Preference-Screen just like suggested in the android reference (search for AbstractAccountAuthenticator, it is explained there) via xml like this:



The Preference-Screen-xml looks like this:


The screen is promted how it should be, but and that is the problem: When I click on the PreferenceScreen with the intent it leads to a crash of the system (both in the emulator and my HTC-Desire).

Logcat says:


Here the part of the manifest, where the activity is defined:


The whole test-code (it is my project on the essentials to find the problem) is to find at googlecode ( cleanproject/source/browse/) (Eclipse-Project)

View 2 Replies View Related

Android :: Application Throws Exception When Rotate Device

Jul 11, 2010

I have developed simple application of progress bar in that when I hit the button then it will do some work in background and one progress bar is visible on foreground. afte completing back ground work it display the same screen. It works fine if I don't rotate mobile but when I rotate mobile then it throws java.lang.IllegalArgumentException: View not attached to window manager

I know when we rotate the device or open keypad it starts activity restarted. But How to avoid this error. My code is.


View 3 Replies View Related

Android :: Database Reading Problem Throws Exception

Mar 30, 2010

I am having this problem with the android database. I adopted the DBAdapter file the NotepadAdv3 example from the google android page.


The error that i am receiving is from Log.e(TAG, e.toString()) in the methods retrieveKey() and storeKey() "no such table: myuserkey: , while compiling: SELECT userkey FROM myuserkey"

View 2 Replies View Related

Android : Starting A New Activity Throws Me Into Debug Mode - Stops App

Jul 22, 2010

I have a listview. Whenever I strike an item of listview the debugger gets opened instead of starting a new activity (i.e. what I want). Code...

P.S. all the xml files are correct.

View 3 Replies View Related

Android :: How To Handle Throws Clause In Java Exception Handling

Sep 4, 2010

I have class A in which I have a method openfileConnec().

It was written like the below:


Now I come to class B where I will call this method like the below:


I was asked a question in an interview as follows:

Why does the method have a throws Exception in its declaration? Is it that on of the methods called in the implementation throws the base class exception? Also If we get a exception during calling the method (fileConnect( )) control goes to catch block. After executing catch where should the control go, what should be sent to base case?

View 2 Replies View Related

Android :: Handler From A Runnable Throws Null Pointer Exception

Sep 20, 2010

I have a Thread that downloads data from internet


There is an activity that needs to be updated according to downloaded data.


Whenever I run above code I get NullPointer Exception .Please help me to update the view.

View 1 Replies View Related

Android :: Activity - Sometimes - Throws Wrong State Class Exception When Being Resumed After Kill

Nov 24, 2009

I'm testing how my app behaves when killed by the OS due to low memory conditions. I always have three activities on the stack, like: A B C (then C launches maps or some other heavy process)

when my app is killed, and I return to it, C starts itself up again ok. When I hit the back button to go to B, I [sometimes] get an exception thrown which I can't trace. Output is below. I don't know where to go from here. I've only seen one other post mentioning this exception, but it was related to a reproducable error when rotating the device. This only happens sometimes.


View 12 Replies View Related

Android :: Starting Service In Separate Thread

Jul 27, 2009

i have a little frontend showing a list of items that it will retrieve from a service. I want that service to be started in a separate the UI is still responding to user interaction while waiting for that service to call a callback method. What is the best way to start the service in a detached thread?

View 6 Replies View Related

Android :: AlarmManager Starting Service - API Level

Nov 10, 2010

I've read comment that the AlarmManager in a earlier API version couldn't start services. Prior to which API Level was that?

I'am currently testing in the emulator with API Level 4 and it start a service just fine.

View 10 Replies View Related

Android :: Starting Activity From Service / Receiver?

Oct 27, 2009

I have a service that sometimes starts applications.The problem is: if the *previous app* (any app) was recently exited via the home key, then the following message appears in the log:ActivityManager: Activity start request from 10024 stopped.And there's then around a 5 second delay before the target app (any) is launched.If the previous app was exited with the back key, there's no problem.If the previous app exited more than a few second ago, no problem.The same also occurs with a broadcast receiver (which also requires the NEW_TASK intent flag to launch an activity).I don't know if the delay was there in 1.5, but I'm assuming not since I can't find the error message in the 1.5 source code.

View 5 Replies View Related

Android :: Starting Class1 From Service Without Application?

Jul 2, 2010

I have a call blocking application. It has 3 files:
1) class BlockMyCall extends BroadcastReceiver
2) class SimpleClass1 extends Service
3) PhoneBlock extends Activity

I start "PhoneBlock " Activity to call Service "SimpleClass1 ", which eventually calls "BlockMyCall" intended to block outbound calls (by setting result to "null").

I want to know if I can run the class1 from service without starting activity. If so , how?

View 2 Replies View Related

Android :: Asynchronous Service Call While Starting Activity

Jul 24, 2010

I am starting an activity from one by passing some data in the intent. I want the next activity to call some asynchronous service (rest service) with the data from intent and show the result on screen.

View 1 Replies View Related

Android :: SDK - Throw A Custom Exception From A Service To An Activity

Nov 26, 2009

I'm currently working on an XMPP app' on Android and I'm pondering about the best way to throw a different type of Exception than a RemoteException to my activity from my service.

As it seems impossible to throw another thing than a RemoteException using IPC (you can't declare to throw anything in your .aidl), I just see two solutions:

Create a listener for my activity to listen on my custom XMPP exception, which in fact will not be thrown but just sent as a usual object implementing the Parcelable protocol.
Catch my XMPPException and throw a RemoteException (with a content updated with my XMPPException) - But in that case, how could I know on my activity if it's an XMPP or a real RemoteException ? By tagging the name of the exception and parsing it on my activity ? It would be really gore.

View 2 Replies View Related

Android :: Call A RESTful Web Service From Application - Exception

Jun 14, 2009

I'm trying to call a RESTful web service from an Android application using the following method:


I can browse to address and see the xml results using the Android Emulator browser and from my machine. I have given my app the INTERNET permission.

I'm developing with eclipse.

I've seen it mentioned that I might need to configure a proxy but since the web service i'm calling is on port 80 this shouldn't matter should it? I can call the method with the browser.

View 5 Replies View Related

Android : Null Pointer Exception When Trying To Connect To Web Service

Jun 2, 2010

My web service should be returning an integer, but every time i run the code i get the NullPointerException error. i think my url string may be the problem, but i've tried using my ip with no luck. Code...

View 1 Replies View Related

Android :: Stopping And Starting Service Based On Application State

Oct 28, 2010

I have a Service which tracks the location of the user. Currently, the Service boots when the application starts and stops when the application terminates. Unfortunately, if users keep the application in the background, the Service never stops and drains battery.

I would like the Service to stop when my application is not in the foreground. I was hoping the Application class would let me Override onPause and onResume handlers, but it does not have them.

View 1 Replies View Related

Android :: Widget Starting Service Also Starts Main Activity

May 3, 2010

I have a widget that is supposed to start and stop a service (start it when it's not running, stop it when it is). This is working fine, however, each time the service is started, my app's main activity is also launched, which I don't want from the app's manifest, it works as I want it to (without launching the main-activity, just the service), but then I obviously don't have a main activity anymore.This is how I start the service (I would assume this is the normal way, and I can't see any reference to what might cause the MAIN intent to fire).

View 1 Replies View Related

Android :: IllegalArgument Exception - Service Is Not Registered - When Unbindservice Is Called

Apr 4, 2010

I am getting IllegalArgumentException: Service is not registered when i try to stop my service by initially calling unbindservice and then stopService.

Before calling unbindService i first check if my service is still bound by checking (mBoundService - obtained from the ServiceConnection) I also check if the service is not stopped and only then i call the unbindService But I still get the error. From the posts that I read only I found out that both these calls are asynchronous and that the service will only stop when nothing is bound to it.

View 2 Replies View Related

Exception In Using LocationClient With A Service?

May 20, 2014

I write a service that should work with LocationClient (Google Play Services). I have an IntentService and an AlarmReceiver (to get location periodically). I have an exception that I cannot catch.


package com.afusionlocation;


View 1 Replies View Related

Motorola Droid :: GTalk Service Starting All By Itself / Stop It?

Nov 23, 2009

So sometimes I'll go into my contacts and notice that some of them have the green ball lit up telling me that they are online in gtalk. Now I am not signed onto gtalk... but yet somehow I see that in my running services that GTalkService is running.

I can only assume that its eating away battery trying to see how is online and not. I certainly don't need this info unless I wish to go online myself... in which case I would actually go into the gtalk app.

ANyways, obviously i've been killing it in the running services, but it just comes back all on its own. ANy idea why or how to stop it?

View 9 Replies View Related

Samsung Epic 4G :: Hotspot Service Running / Stop It From Starting?

Sep 18, 2010

Ok, so i go to check running services and i see that sprint hotspot is running. i have not started it since the day i bought the phone. i have no intention of using it, for now. why is it running and how can i stop it from starting? is it supposed to be running?

View 2 Replies View Related

Android :: Exception With Web Service ( Permission Denied) In Android

Nov 23, 2010

When I call a Web Service, it returns me this exception: Permission denied. I dont know waht is the actual problem. I don't know how to solve this? page:............

View 2 Replies View Related

Android :: Google Maps API Gives A NoClassDefFoundError

Sep 25, 2010

My app just consists of a map with an overlay, but when I create my MapView, my app crashes with a NoClassDefFoundError. I'm using the Google API AVD that matches my target, but apparently I'm still doing something wrong.

In case it helps, my NoClassDefFoundError is complaining about [generic]. I can understand why there's no class definiton for [generic], but I'm not sure where that's coming from.

Also, a later ClassNotFoundException complains of in loader dalvik.system.PathClassLoader[/data/app/mathphreak.cellmap-1.apk], and that then goes on to cause a different NoClassDefFoundError for java.lang.NoClassDefFoundError:

View 1 Replies View Related

Android :: NoClassDefFoundError When Running Facebook ?

Aug 3, 2010

I try to use Official Android SDK ( I install the SDK and try to run the Example

At first, it fails at "build", it cannot find the Facebook SDK, so I try to follow the steps found in SDK page:

Add a dependency on the Facebook Android SDK library on your application:

From the File menu, select "Properties" once the project Properties are displayed, open the Android section, which should list the build targets and libraries in the bottom "Library" section, click "Add..." and select the Facebook SDK project refer to [url] for more details

I check the link at #4, it shows a Mac OS X version Eclipse, which has Library section, but on my Vista PC, with Eclipse 3.5.2, it does not have Library section...



I try to add the Facebook SDK in Java Build Path. Now it can "build" and start, on both Emulator and Device. However, once it started, it crash, the logcat shows: ERROR/AndroidRuntime(518): java.lang.NoClassDefFoundError:


I searched around, about "NoClassDefFoundError" program, but seems those solution is solving external JARs files. I have no problem adding other JARs files, and this Facebook SDK is not JAR...

I tried Clean, rebuild, delete everything and config again, but can't solve this problem yet.

View 2 Replies View Related

Android :: NoClassDefFoundError For Gdata CalendarService Class

Mar 13, 2010

I'm writing an android 2.1 application that writes an entry to my Google calendar.

The relevant part of my application code looks like this:


This code compiles with no errors, using Eclipse on MacOS, using external jar files from the Google gdata project: gdata/java/lib/gdata-calendar-2.0.jar gdata/java/lib/gdata-calendar-meta-2.0.jar

I export the application through Eclipse to generate the .apk file which I install on my N-1 phone. However the application cannot find the CalendarService class, giving me the following runtime error:


When developing other android applications the "external jar files" always seem to be cross-compiled and packed into the apk file - so I do not understand why the app cannot find the CalendarService class.

View 14 Replies View Related

Android :: Unit Testing Project Gets A NoClassDefFoundError For 3rd Party Jars

Oct 27, 2010

I'm trying to run unit tests on my Android app and I'm getting a NoClassDefFoundError when referencing 3rd party jars.

The classes in those jars are only referenced by the app itself, not the unit tests. The jars are on the apps classpath and have been exported in the eclipse settings to allow tyhem to be found by dependant apps - which, of course, the test app is.

View 1 Replies View Related

Copyrights 2005-15, All rights reserved