Android :: How To Debug Unexpected Exceptions (source Not Found)

Feb 9, 2010

I am pretty new to Android, the thing that bugs me the most about the IDE is that I am not able to get any information about an unexpected exception when it gets thrown, I can put a try catch block around identified code that generates it, but in many cases it takes time to find the line of code that generates the exception. is there any other way I can get the exception information? in JDT when an unexpected exception is thrown the call stack displays the exception class name. but in ADT this doesn't work.

Android :: How to debug unexpected exceptions (source not found)


Android :: Enable Debug Logging In Droid Source?

Feb 28, 2009

In android source code, it has logging statements like Log.d(). Log.i().

Can you please tell me how to enable the debug logging?

View 3 Replies View Related

Android :: Source Not Found - Program Crashes

Aug 30, 2010

I'm getting an error in my Android app that says "source not found" and crashes the program. I've already read a number of posts saying that the solution is to download the android source code and load that up in Eclipse, but I tried to no avail. Here is a bunch of information that may help with my problem, let me know if you need more!

Stack:
Thread [<1> main] (Suspended (exception RuntimeException))
ActivityThread.performLaunchActivity(ActivityThrea d$ActivityRecord, Intent) line: 2663
ActivityThread.handleLaunchActivity(ActivityThread $ActivityRecord, Intent) line: 2679
ActivityThread.access$2300(ActivityThread, ActivityThread$ActivityRecord, Intent) line: 125
ActivityThread$H.handleMessage(Message) line: 2033
ActivityThread$H(Handler).dispatchMessage(Message) line: 99
Looper.loop() line: 123
ActivityThread.main(String[]) line: 4627
Method.invokeNative(Object, Object[], Class, Class[], Class, int, boolean) line: not available [native method]
Method.invoke(Object, Object...) line: 521
ZygoteInit$MethodAndArgsCaller.run() line: 868
ZygoteInit.main(String[]) line: 626
NativeStart.main(String[]) line: not available [native method]

Is it weird that the first entry is 'ActivityThrea d' with the 'd' cut off? If this is the problem, what went wrong and how do I fix it? The line of code the debug stops on:

public void AddAnimationID(String index, Integer view)
{ animations.put(index, view);
}
'animations' is a Dictionary and is a member of class Alien. I am calling it like:
Alien alien;
alien.AddAnimationID("idle", R.drawable.idle);
I am correct in thinking that R.drawable.idle is an int right? findViewByID takes an int for the argument. Here is the logcat, I tried to pinpoint where in the log it started the application, sorry if its too much.

I/ActivityManager(59): Displayed activity com.android.launcher/com.android.la
uncher2.Launcher: 21357 ms (total 21357 ms)
I/Launcher.Model(118): not binding apps: no Launcher activity
D/dalvikvm(118): GC_EXPLICIT freed 5222 objects / 297520 bytes in 114ms
D/dalvikvm( 118): GC_EXPLICIT freed 11360 objects / 562112 bytes in 94ms
D/PackageParser(59): Scanning package: /data/app/vmdl45576.tmp
I/PackageParser(59): Game.Main: compat added android.permission.WRITE_EXTERNA
L_STORAGE android.permission.READ_PHONE_STATE
I/PackageManager(59): Removing non-system package:Game.Main
I/ActivityManager(59): Force stopping package Game.Main uid=10032
D/dalvikvm(118): GC_EXTERNAL_ALLOC freed 319 objects / 18064 bytes in 73ms
D/dalvikvm(59): GC_FOR_MALLOC freed 6857 objects / 349752 bytes in 400ms
D/PackageManager(59): Scanning package Game.Main
I/PackageManager(59): Package Game.Main codePath changed from /data/app/Game.
Main-2.apk to /data/app/Game.Main-1.apk; Retaining data and using new
I/PackageManager(59): /data/app/Game.Main-1.apk changed; unpacking
D/installd(34): DexInv: --- BEGIN '/data/app/Game.Main-1.apk' ---
I/ActivityManager(59): Starting activity: Intent { act=android.intent.action.
MAIN cat=[android.intent.category.LAUNCHER] flg=0x10200000 cmp=Game.Main/.Main }

D/dalvikvm(258): DexOpt: load 116ms, verify 200ms, opt 2ms
D/installd(34): DexInv: --- END '/data/app/Game.Main-1.apk' (success) ---
W/PackageManager(59): Code path for pkg : Game.Main changing from /data/app/G
ame.Main-2.apk to /data/app/Game.Main-1.apk
W/PackageManager(59): Resource path for pkg : Game.Main changing from /data/a
pp/Game.Main-2.apk to /data/app/Game.Main-1.apk
D/PackageManager(59): Activities: Game.Main.Main
I/ActivityManager(59): Force stopping package Game.Main uid=10032
E/Launcher(118): Unable to launch. tag=ApplicationInfo(title=Alien Game) inten
t=Intent { act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER]flg=0x10200000 cmp=Game.Main/.Main }
E/Launcher(118): android.content.ActivityNotFoundException: Unable to find exp
licit activity class {Game.Main/Game.Main.Main}; have you declared this activity in your AndroidManifest.xml?
E/Launcher(118): at android.app.Instrumentation.checkStartActivityResult(
Instrumentation.java:1404)
E/Launcher(118): at android.app.Instrumentation.execStartActivity(Instrum
entation.java:1378)
E/Launcher(118): at android.app.Activity.startActivityForResult(Activity.
java:2817)
E/Launcher(118): at com.android.launcher2.Launcher.startActivityForResult
(Launcher.java:1053)
E/Launcher(118): at android.app.Activity.startActivity(Activity.java:2923)
E/Launcher(118): at com.android.launcher2.Launcher.startActivitySafely(Launcher.java:1462)
E/Launcher(118): at com.android.launcher2.AllApps2D.onItemClick(AllApps2D
.java:178)
E/Launcher(118): at android.widget.AdapterView.performItemClick(AdapterVi
ew.java:284)
E/Launcher(118): at android.widget.AbsListView$PerformClick.run(AbsListVi
ew.java:1696)
E/Launcher(118): at android.os.Handler.handleCallback(Handler.java:587)
E/Launcher(118): at android.os.Handler.dispatchMessage(Handler.java:92)
E/Launcher(118): at android.os.Looper.loop(Looper.java:123)
E/Launcher(118): at android.app.ActivityThread.main(ActivityThread.java:4627)
E/Launcher(118): at java.lang.reflect.Method.invokeNative(Native Method)
E/Launcher(118): at java.lang.reflect.Method.invoke(Method.java:521)
E/Launcher(118): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:868)
E/Launcher(118): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626)
E/Launcher(118): at dalvik.system.NativeStart.main(Native Method)
I/installd(34): move /data/dalvik-cache/data@app@Game.Main-1.apk@classes.dex
-> /data/dalvik-cache/data@app@Game.Main-1.apk@classes.dex
D/PackageManager(59): New package installed in /data/app/Game.Main-1.apk
I/ActivityManager(59): Force stopping package Game.Main uid=10032
I/ActivityManager(59): Start proc com.svox.pico for broadcast com.svox.pico/.
VoiceDataInstallerReceiver: pid=259 uid=10028 gids={}
D/dalvikvm(157): GC_EXPLICIT freed 4079 objects / 247824 bytes in 605ms
D/dalvikvm(59): GC_EXPLICIT freed 6136 objects / 382312 bytes in 493ms
W/RecognitionManagerService( 59): no available voice recognition services found
I/installd(34): unlink /data/dalvik-cache/data@app@Game.Main-2.apk@classes.dex
D/AndroidRuntime(191): Shutting down VM
D/jdwp(191): adbd disconnected
I/AndroidRuntime(191): NOTE: attach of thread 'Binder Thread #3' failed
I/ActivityThread(259): Publishing provider com.svox.pico.providers.SettingsPro
vider: com.svox.pico.providers.SettingsProvider
D/AndroidRuntime(269):
D/AndroidRuntime(269): >>>>>>>>>>>>>> AndroidRuntime START <<<<<<<<<<<<<<
D/AndroidRuntime(269): CheckJNI is ON
D/AndroidRuntime(269): --- registering native functions ---
I/ActivityManager(59): Starting activity: Intent { act=android.intent.action.
MAIN cat=[android.intent.category.LAUNCHER] flg=0x10200000 cmp=Game.Main/.Main }

I/ActivityManager(59): Start proc Game.Main for activity Game.Main/.Main: pid=273 uid=10032 gids={1015}
I/ARMAssembler(59): generated scanline__00000077:03545404_00000004_00000000 [ 47 ipp] (67 ins) at [0x322b68:0x322c74] in 4370882 ns
W/Game.Main.Main(273): SIS is null
D/AndroidRuntime(273): Shutting down VM
W/dalvikvm(273): threadid=1: thread exiting with uncaught exception (group=0x4001d800)
E/AndroidRuntime(273): FATAL EXCEPTION: main
E/AndroidRuntime(273): java.lang.RuntimeException: Unable to start activity ComponentInfo{Game.Main/Game.Main.Main}: java.lang.NullPointerException
E/AndroidRuntime(273): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2663)
E/AndroidRuntime(273): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2679)
E/AndroidRuntime(273): at android.app.ActivityThread.access$2300(Activi
tyThread.java:125)
E/AndroidRuntime(273): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2033)
E/AndroidRuntime(273): at android.os.Handler.dispatchMessage(Handler.java:99)
E/AndroidRuntime(273): at android.os.Looper.loop(Looper.java:123)
E/AndroidRuntime(273): at android.app.ActivityThread.main(ActivityThread.java:4627)
E/AndroidRuntime(273): at java.lang.reflect.Method.invokeNative(Native Method)
E/AndroidRuntime(273): at java.lang.reflect.Method.invoke(Method.java:521)
E/AndroidRuntime(273): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:868)
E/AndroidRuntime(273): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626)
E/AndroidRuntime(273): at dalvik.system.NativeStart.main(Native Method)
E/AndroidRuntime(273): Caused by: java.lang.NullPointerException
E/AndroidRuntime(273): at Game.Main.Main.onCreate(Main.java:81)
E/AndroidRuntime(273): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047)
E/AndroidRuntime(273): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2627)
E/AndroidRuntime(273): ... 11 more
W/ActivityManager(59): Force finishing activity Game.Main/.Main
I/ActivityManager(59): Starting activity: Intent { act=android.intent.action.
MAIN cat=[android.intent.category.LAUNCHER] flg=0x10000000 cmp=Game.Main/.Main }
D/AndroidRuntime(269): Shutting down VM
D/jdwp (269): adbd disconnected
I/AndroidRuntime(269): NOTE: attach of thread 'Binder Thread #3' failed
W/ActivityManager(59): Activity pause timeout for HistoryRecord{43ed84f8 Game.Main/.Main}
I/ARMAssembler(59): generated scanline__00000077:03515104_00000000_00000000 [ 33 ipp] (47 ins) at [0x305640:0x3056fc] in 1148283 ns
W/ActivityManager(59): Launch timeout has expired, giving up wake lock!

Here is the class Alien:
package Game.Main;
import java.util.Dictionary;
import android.graphics.drawable.AnimationDrawable;
import android.widget.ImageView;
public class Alien {
private AlienState state;
private Dictionary<String, Integer> animations;
private ImageView imageView;
public Alien() {
}
public void AddAnimationID(String index, Integer view) {
animations.put(index, view);
}
public Integer GetAnimationID(String index) {
return animations.get(index);
}
public void SetImageView(ImageView view) {
imageView = view;
if(animations.get("idle") != null) {
imageView.setBackgroundResource(R.drawable.idle);
state = AlienState.idle;
} }
public ImageView GetImageView() {
return imageView;
} public void ChangeView(String index) {
if(animations.get(index) != null) {
imageView.setBackgroundResource(animations.get(index));
state = AlienState.valueOf(index);
} } }

Here is the onCreate function that this is called from and related information:
package Game.Main;
import java.util.ArrayList;
import java.util.List;
import Game.Main.MainView.MainThread;
import android.app.Activity;
import android.content.Intent;
import android.content.pm.PackageManager;
import android.content.pm.ResolveInfo;
import android.graphics.drawable.AnimationDrawable;
import android.os.Bundle;
import android.speech.RecognizerIntent;
import android.util.Log;
import android.view.View;
import android.view.View.OnClickListener;
import android.view.animation.Animation.AnimationListener;
import android.widget.Button;
import android.widget.ImageView;
import android.widget.TextView;

public class Main extends Activity implements OnClickListener {
private static final int VOICE_RECOGNITION_REQUEST_CODE = 1234;
private ArrayList<String> dictionary;
private TextView txtText;
private MainThread thread;
private MainView view;
private AnimationDrawable anim;
private Alien alien;
@Override // called when Main is created.
public void onCreate(Bundle savedInstanceState) {
// reload from previous instance
super.onCreate(savedInstanceState);
// set default content view
setContentView(R.layout.main);
view = (MainView)findViewById(R.id.mainView);
thread = view.GetThread();
if (savedInstanceState == null) {
// we were just launched: set up a new game
thread.SetState(GameState.Active);
Log.w(this.getClass().getName(), "SIS is null");
} else {
// we are being restored: resume a previous game
thread.RestoreState(savedInstanceState);
Log.w(this.getClass().getName(), "SIS is nonnull");
} // setup speak button
Button speakButton = (Button)findViewById(R.id.btn_speak);
// setup text box
txtText = (TextView)findViewById(R.id.txt_text);
// setup our dictionary
dictionary = new ArrayList<String>();
dictionary.add("sit");
dictionary.add("eat");
dictionary.add("jump");
dictionary.add("think");

alien.AddAnimationID("idle", R.drawable.idle);
alien.AddAnimationID("eat", R.drawable.eat);
alien.AddAnimationID("jump", R.drawable.jump);
alien.AddAnimationID("think", R.drawable.think);
alien.AddAnimationID("run", R.drawable.run);
alien.AddAnimationID("sit", R.drawable.sit);
alien.SetImageView((ImageView)findViewById(R.id.alien_image));
// check to see if a recognition activity is present
PackageManager pm = getPackageManager();
List<ResolveInfo> activities = pm.queryIntentActivities(new Intent(RecognizerIntent.ACTION_RECOGNIZE_SPEECH), 0);
// if activities were found, cancel speech recognition
if (activities.size() != 0)
speakButton.setOnClickListener(this);
else {
speakButton.setEnabled(false);
speakButton.setText("Recognizer not present");
} }
I am using Eclipse on Windows 7 x64. I have all of the newest updates to the android SDK and I downloaded the android source code and added it to the Eclipse patch because previous posts led me to try that. The code breaks for debug when the first time AddAnimationID is called. Looks like I didn't have enough breakpoints, the culprit is not the AddAnimationID function but actually the SetImageView one. The if statement seems to not work, so I've commented it out for now. I'll post back once I've figured it out. It's probably something silly that works in another language but not Java.

View 1 Replies View Related

Android :: Get Contacts Groups / Source Not Found Error

Feb 26, 2010

Problem 1.
I have this class:
public class ContactGroups {
// Form an array specifying which columns to return.
String[] projection = new String[] { Contacts.Groups._ID,
Contacts.Groups._COUNT, Contacts.Groups.NAME, Contacts.Groups.NOTES };

public Cursor getList(Activity act) {
Uri contacts = Contacts.Groups.CONTENT_URI;
// using the debugger code kills here
Cursor managedCursor = act.managedQuery(contacts, projection,
null, null, null );
return managedCursor;
} public ArrayList<String> getColumnData(Cursor cur) { ArrayList<String> aa = new ArrayList<String>();
if (cur.moveToFirst()) { String name;
String notes;
int nameColumn = cur.getColumnIndex(Contacts.Groups.NAME);
int notesColumn = cur.getColumnIndex(Contacts.Groups.NOTES);
do {
// Get the field values name = cur.getString(nameColumn);
notes = cur.getString(notesColumn);
aa.add(name);
// Do something with the values. } while (cur.moveToNext())
} return aa;
} }

I am calling this as:
ContactGroups mGrp= new ContactGroups();
final ArrayAdapter<String> aa;
aa = new ArrayAdapter<String>(this, android.R.layout.simple_list_item_1,mGrp.getColumnData(mGrp.getList(this)));
myListView.setAdapter(aa);

And having:
<uses-permission android:name="android.permission.READ_CONTACTS"></uses-permission>
<uses-permission android:name="android.permission.WRITE_CONTACTS"></uses-permission>

I get a Source not found error and a Logcat error
ERROR/DatabaseUtils(617): java.lang.IllegalArgumentException: Invalid column _count

Problem 2.
Where do I create manually contact groups?

View 1 Replies View Related

Android :: Intent Runtime Error Source Not Found

Jun 5, 2010

I create 2 simple activities, first activity is to login, after that proceed to the second activity. However, the intent is having some runtime error: saying that the sources is not found.

View 2 Replies View Related

Getting Error While Running Android Application As Source Not Found?

May 8, 2012

I am getting an error while running android application as "Source not found"...

View 5 Replies View Related

Android :: Basic Application Web Service Access - Source Not Found?

Feb 27, 2009

I am coding a basic android application that has to call a web service, using KSOAP2, I am sending a request with one parameter (city) and need to get the response of the web service (basically a short String) from this site:
http://www.deeptraining.com/webservices/weather.asmx?op=GetWeather

When execultin the application, I only get a message: "This application has stopped unexpectedly". When debugging, I am getting the following error:
Thread [<3> main] (Suspended (exception VerifyError) And: ViewRoot.handleMessage(Message) line: 1198 that says: Source not Found And shows a button allowing to: Edit Source Lookup path. What does this basically mean?

My source code that generates the is the following:
private static final String SoapAction = "http://www.deeptraining.com/ webservices/GetWeather"; private static final String MethodName = "GetWeather"; private static final String Namespace = "http://www.deeptraining.com/ webservices/"; private static final String URL = "http://www.deeptraining.com/ webservices/weather.asmx";

And the main part of it: SoapObject request = new SoapObject(Namespace, MethodName); request.addProperty("City", cityname); SoapSerializationEnvelope envelope = new SoapSerializationEnvelope (SoapEnvelope.VER11); envelope.setOutputSoapObject(request); HttpTransport androidHttpTransport = new HttpTransport(URL); try { Result.setText("... Processing ..."); //error here: androidHttpTransport.call(SoapAction, envelope); ...
I am using Eclipse with Android plugin and KSOAP2 library.

View 2 Replies View Related

General :: Command Not Found Error While Trying To Compile Kernel From Source With NDK

Mar 29, 2014

I am following this right here [URL] .... And i keep getting command not found even though i am sure its right.

Code:
~/AlienKernel3.0-alien-4 $ export CROSS_COMPILE=/home/user/ndk/android-ndk-r9c/toolchains/arm-linux-androideabi-4.8/prebuilt/linux-x86_64/bin/arm-linux-androideabi-

Code:
sudo make clean && sudo make mrproper

Code:
make: /home/dm47021/Android/toolchains/arm-unknown-linux-gnueabi-linaro_4.8.2-2013.08/bin/arm-unknown-linux-gnueabi-gcc: Command not found
/bin/bash: /scripts/gcc-version.sh: No such file or directory

[Code] ....

View 1 Replies View Related

Android :: Debug Android Source Code Using Eclipse?

May 13, 2009

Is there a way to debug Android source code with eclipse?

View 4 Replies View Related

Android :: "Source Not Found" Error In Eclipse / Fix It?

Jul 30, 2010

Developing my first app for android. Works OK on emulator, but on phone I get a "Source not found error" ViewRoot.handleMessage(Message)line:1757. I get the error when I press button number 4 on the application and try to display my media images on phone

Code...

View 1 Replies View Related

Android :: Unexpected End Of Document Exception

Nov 21, 2010

I'm getting a "SAXParseException: Unexpected end of document" error when trying to parse an xml document on android. The document in question is from the google weather api, but it seems to throw the same error regardless of the xml file in question (as long as the xml is valid) so I suspect it's a problem with my approach, rather than the xml. This is being done as a learning exercise, so I've probably (hopefully) overlooked something obvious. I've run the xml through an online validator, and it comes back as being well formed. (Can't tell me if it's valid as I don't have a DTD, but I dont think I need the DTD to parse the xml). This is the code that I'm using to try and parse the file:

private void refreshForecast() URL url;
try { url = new URL( "http://192.168.1.66:8000/google4.xml");
URLConnection connection = url.openConnection();
HttpURLConnection httpConnection = (HttpURLConnection)connection;
int responseCode = httpConnection.getResponseCode();
if (responseCode == HttpURLConnection.HTTP_OK) {
InputStream in = httpConnection.getInputStream();
DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
DocumentBuilder db = dbf.newDocumentBuilder();
// falls over here parsing the xml.Document dom = db.parse(in);
} } catch (ManyExceptions e) { ....
} A cutdown version of the xml that produces the error is:

<?xml version="1.0"?>
<xml_api_reply version="1">
<weather>
<forecast_information>
<city>Hamilton</city>
</forecast_information>
</weather>
</xml_api_reply>

The stacktrace is:
11-20 06:17:24.416: WARN/System.err(406): org.xml.sax.SAXParseException: Unexpected end of document
11-20 06:17:24.416: WARN/System.err(406): at org.apache.harmony.xml.parsers.DocumentBuilderImpl.parse(DocumentBuilderImpl.java:131)
11-20 06:17:24.416: WARN/System.err(406): at javax.xml.parsers.DocumentBuilder.parse(DocumentBuilder.java:110)
11-20 06:17:24.426: WARN/System.err(406): at com.dave.nzweather.WeatherApp.refreshForecast(WeatherApp.java:159)
11-20 06:17:24.426: WARN/System.err(406): at com.dave.nzweather.WeatherApp.onCreate(WeatherApp.java:100)
11-20 06:17:24.426: WARN/System.err(406): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047)
11-20 06:17:24.438: WARN/System.err(406): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2627)
11-20 06:17:24.438: WARN/System.err(406): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2679)
11-20 06:17:24.446: WARN/System.err(406): at android.app.ActivityThread.access$2300(ActivityThread.java:125)
11-20 06:17:24.446: WARN/System.err(406): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2033)
11-20 06:17:24.456: WARN/System.err(406): at android.os.Handler.dispatchMessage(Handler.java:99)
11-20 06:17:24.456: WARN/System.err(406): at android.os.Looper.loop(Looper.java:123)
11-20 06:17:24.456: WARN/System.err(406): at android.app.ActivityThread.main(ActivityThread.java:4627)
11-20 06:17:24.466: WARN/System.err(406): at java.lang.reflect.Method.invokeNative(Native Method)
11-20 06:17:24.466: WARN/System.err(406): at java.lang.reflect.Method.invoke(Method.java:521)
11-20 06:17:24.466: WARN/System.err(406): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:868)
11-20 06:17:24.476: WARN/System.err(406): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626)
11-20 06:17:24.476: WARN/System.err(406): at dalvik.system.NativeStart.main(Native Method)
11-20 06:17:24.486: WARN/ROGER(406): org.xml.sax.SAXParseException: Unexpected end of document

In the interest of brevity, I've not included the original xml, but it's just the standard weather xml from googles feed. I've also tried a few completely different xml files, (including the sample from http://www.ibm.com/developerworks/xml/library/x-android/) and they all give the same error. (They also all validate as well formed when I run them through an online xml validator). This makes me think that it's not a problem with the xml, but rather with how I'm trying to feed it into the parser.

View 2 Replies View Related

Android :: Checkbox In List Being Checked Unexpected

Feb 16, 2010

I have list of checkboxes in list binded by Custom simpleCurserAdapter. in my Custom simpleCurserAdapter ive override the newview and binview with my modifications. ive managed somehow to do multichoice.. wierd thing after i delete any item from my list , the first item's checkbox is being checked all of a sudden.. how does that happen? how can i solve it?

code: my curser SimpleCursorAdapter class:

CODE:......

I couldnt find another way of doing this, but this is how i set listeners to my checkboxses

CODE:.....

Now this is code part from the ListActivity class which desbribes the button which deleting the checked Box items

CODE:......................

View 3 Replies View Related

Android :: SensorManager.registerListener Gives Unexpected Results

Nov 30, 2009

I'm registering a sensor listener with this line of code.

mSensorManager.registerListener(this,mSensorManager.getDefaultSensor (Sensor.TYPE_ACCELEROMETER), SensorManager.SENSOR_DELAY_FASTEST);

The rate is set to SENSOR_DELAY_FASTEST with the expectation that I would receive events roughly every 20-30ms. It turns out that I receive events only every 200-220ms (just now, my event code simply logcats the system time).

No matter which rate I use, SENSOR_DELAY_NORMAL, SENSOR_DELAY_UI, SENSOR_DELAY_GAME, or SENSOR_DELAY_FASTEST, I get the same result?

View 15 Replies View Related

Android :: Astrid Warning - Prevent Unexpected Erase?

Feb 12, 2010

Got a Samsung Moment a couple of weeks ago. Last night starting using Astrid (Task/ToDo app), which came pre-installed on my phone. When I launched Astrid for the first time, I got a warning message -- something about making sure Sprint Update or Sprint Updater doesn't kill Astrid, or ruin it, or something. Clearly, I didn't understand the message. But I clicked "Okay" anyway, and started using Astrid. But I'm worried that a Sprint Update could erase all my Astrid data -- my To Do's. I'm reluctant to create many Astrid tasks until I know how to prevent them from being unexpectedly erased. My questions: Can anyone explain the situation to me? (e.g., I have no idea who/when/how/where/what Sprint updates). Can anyone explain what I need to do to prevent the catastrophe about which Astrid was warning me?

View 1 Replies View Related

Android :: Unexpected Visual Element In Simple Tab Layout

Jun 19, 2010

The screen shot below is of a simplified version of the application from the Tab Layout tutorial. You can see a black horizontal line below the tabs. Why is it there and how can I remove it?

View 2 Replies View Related

Android :: Catch Standard Exceptions

Aug 21, 2009

I want to listen the android standard exceptions to manage it. But I don't put try/cath in all my code. Anyone knows if i can redirect the error output to my code. I've seen this System.setErr method, but It doens't works for this purpouse.

View 2 Replies View Related

Android :: Exceptions With Calling Web Service Using IP

Nov 24, 2010

when I call web service from my machine using 'localhost' or 127.0.0.1 , I got exception. But if I give the public IP, it works fine. Why it is happening?And also, If I use my public IP, I can't access web service. But If I put the same code in another machine, and call that web service using the IP address of that machine, It works fine.

View 2 Replies View Related

Android :: Catching Exceptions Globally?

Aug 12, 2009

In my application I would like to catch all exceptions globally - it should not matter, where those exceptions occur. Some runtime exceptions are practically impossible to catch (OutOfMemoryError for instance), but I want to show an informative dialog and resume execution at some well-defined point (main menu activity or something).

Using Thread.setDefaultUncaughtExceptionHandler() does this for background threads, but it is of no help in the UI thread (or adjacent handlers). If an exception occurs in the UI thread, the UI will be jammed - not reacting to any key or touch events anymore. Of course, this seems natural since it did not catch that exception; but I wonder if there is a way to recover the UI thread. So:

- Can I recover / restart the UI thread after an uncaught exception (from another thread) ?

- Is there another way to catch uncaught exceptions globally ?

- Are there viable alternatives to handle this problem ?

View 2 Replies View Related

Android :: Why Do I Constantly Get ActivityNotFound Exceptions

Aug 9, 2010

I'm a novice Android programmer, and to help me understand how Intents really work, I wanted to put together a small Activity which would let the user call startActivity() with any action and data they want. I tried many different combinations, including "android.intent.action.VIEW" and "http://www.google.com". No matter what combinations I use, I always get an ActivityNotFoundException. Any ideas as to why?

The code in my only Activity is below....

View 2 Replies View Related

Android : How To Email Uncaught Exceptions?

Oct 15, 2010

I love the feature where we can inspect any exceptions for app's published on the market through the developer site but curious as to whether we can tap into this feature for app's we don't publish to the market so we can email any exception details to a specific email address for example.

View 3 Replies View Related

Android :: Handle Unexpected Internet Disconnect While Downloading Data

Mar 31, 2010

I have here a function that downloads data from a remote server to file. I am still not confident with my code. My question is, what if while reading the stream and saving the data to a file and suddenly I was disconnected in the internet, will these catch exceptions below can really catch that kind of incident? If not, can you suggest how to handle this kind of incident?

I call this function in a thread so that the UI won't be blocked.

CODE:...................

View 1 Replies View Related

Android :: How To Print Stack Traces For Exceptions?

Nov 17, 2010

Does anyone know how to print stack traces for exceptions caught while running in the Android emulator in Eclipse? I catch the exception and call .printStackTrace() but I cannot find where it is being written. I have tried .printStackTrace(System.out) and .printStackTrace(System.err). I would be nice to be able to direct them to the Eclipse console.

View 2 Replies View Related

Android :: Where JavaScript Exceptions Displayed When Using WebView

Feb 9, 2010

I have this simple HTML that I load into an Android WebView (SDK version 1.5)-

<html>
<body onload="nomethod()">
<h1>Hello World</h1>
</body>
</html>

Function nomethod() doesn't exist but the LogCat doesn't display any error. It seems that any exception that isn't caught cannot be traced. how can I handle or trace uncaught exceptions?

View 1 Replies View Related

Android :: Sample Code To Handle Exceptions

Sep 27, 2010

I am new to Android mobile application development.I would like to know , how can I handle the exception , like HttpConnection related exceptions or any other exceptions.Do I need to display an AlertDialog to the user.Kindly provide a sample code or project source code on how can I handle HttpConnection or similar type of Exceptions.

View 1 Replies View Related

Android :: RelativeLayout Fill_parent Unexpected Behavior In A ListView With Varying Row Heights

Apr 29, 2010

I'm currently working on a small update to a project and I'm having an issue with Relative_Layout and fill_parent in a list view. I'm trying to insert a divider between two sections in each row, much like the divider in the call log of the default dialer. I checked out the Android source code to see how they did it, but I encountered a problem when replicating their solution.

To start, here is my row item layout:

CODE:..........

The issue I'm facing is that each row has a thumbnail of varying height (ImageView01). If I set the RelativeLayout's layout_height property to fill_parent, the divider does not scale vertically to fill the row (it just remains a 1px dot). If I set layout_height to "?android:attr/listPreferredItemHeight", the divider fills the row, but the thumbnails shrink. I've done some debugging in the getView() method of the adapter, and it seems that the divider's height is not being set properly once the row has it's proper height.

Here is a portion of the getView() method:

CODE:.........

The rest of the method simply sets the appropriate text and images for the row.

Also, I create the inflater object in the adapter's constructor with: inflater = LayoutInflater.from(context);

Am I missing something essential? Or does fill_parent just not work with dynamic heights?

View 1 Replies View Related

Android : Child Activity Exit By Unexpected Exception - OnActivityResult - Is Not Called

Jun 23, 2010

I have faced with issue about startActivityForResult() and onActivityResult(). If child activity started by the startActivityForResult() exit by unexpected exception the onActivityResult() is not called and I have no any ideas how can I handle this to get application working in a fail-safe manner ?

When my code runs child activity with startActivityForResult() it awaits until onActivityResult() will be invoked to get working further, but onActivityResult() is not calling and my code is "hang- up" (logically).

So the question is how can I handle all possible ways the child activity is finished (normally and by unexpected exception) to get fail-safe code ?

I have check the documentation for this issue but have found nothing relating issue.

View 4 Replies View Related

Android :: Strange Exceptions When Deleting And Reading Contacts

Sep 8, 2010

I am getting following exceptions when I try to read/delete contacts from my application using Contacts Content Provider. What does the following mean? ERROR/IMemory(1349)

View 3 Replies View Related

Android :: Async Thread Aborted After Catching (all?) Exceptions

Nov 11, 2009

I have the following code...

CODE:.................

My mClient get method is a simple HttpClient execute with an output buffer to read the input stream, so it's very trivial. Everytime I execute this task UnknownHostException will be triggered which will in turn call onTaskError on my currect Activity, but I still get a RuntimeException, but I don't see why. Maybe it's because it's late and i've done about 12 hours of writing code so it's something simple I just can't see?

View 6 Replies View Related

Android :: Catching Intent Exceptions And/or Return Codes?

Mar 12, 2010

I've a piece of code that launches an Intent. I'm wondering if there's any way to get return codes and/or catch exceptions? The particular scenario I'm facing is when I launch an Intent passing a 'rtsp' URL but it turns out the URL isn't available.

View 1 Replies View Related

Android :: Thread Always Seem To Throw Exceptions Although No Erros In Program

Apr 11, 2010

Hello, I use a thread for drawing to the canvas. By coincidence I recognized that in the program always jumps into the finally part. After view.onDraw(c); is reached it steps back to synchronized (surfaceHolder) and then it steps into the finally part. This happens every time. This means to me that every time exceptions are thrown.

Can anybody explain why this is so?

CODE:......................

View 3 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved