Android :: Custom ListAdapter Extending BaseAdapter Crashes On Application Launch

Mar 23, 2010

Data being pulled from a local DB, then mapped using a cursor. Custom Adapter displays data similar to a ListView. As items are added/deleted from the DB, the adapter is supposed to refresh. The solution attempted below crashes the application at launch.

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

Errors:

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

Android :: Custom ListAdapter extending BaseAdapter crashes on application launch


Android :: Market And Gmail Application Crashes On Launch

Jan 25, 2010

I have a G1 Android that's been rooted. My problem is that Market and Gmail crashes on launch. I also cannot get to the Data Synchronization page. It displays the page for a split second and then instantly closes out. Is there a way to reset the apps? I've tried factory reset and upgrading to a newer version of Cyanogen mod without success.

View 1 Replies View Related

Android :: Finish Activity From Custom BaseAdapter

Nov 22, 2010

In my android application I have custom listview with an image and textview. In extended BaseAdapter under getView method click events of textview and image are associated with onClick method using setOnClickListener as shown in code below

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

And

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

When clicking on image it acutally deletes that entry from List which works fine, but on clicking textview i would like to return the text of clicked textview to main activity but I am unable to achieve this, although I can do this from setOnItemClickListener of this custom listview acitivity.

View 1 Replies View Related

Android :: Custom BaseAdapter - Dynamic Updates - Crash In ListView Layout

Feb 16, 2010

I'm trying to get my first Android app stable enough for the marketplace, and I've hit a brick wall with one exception that I don't understand. Probably I'm doing something stupid, but I can't tell what, and after several hours googling and experimenting, I thought I'd see if I can get some help. My Activity extends ListActivity, and the parts I think are most important are extracted below:

GroupedListAdapter is a simple class that extends BasedAdapter to provide headings for sections of the list (not unlike the Fancy ListView tutorials that are floating around).

I create this in onCreate, and it works fine. Inside onListItemClick, I do some actions which will create a different set of list contents. I "clear" the adapter, which empties the contents, and call reload, which repopulates it. Then I call notifyDataSetChanged.

Most often, this seems to work, but also fairly often, I get the exception following the code snippets below - this seems to indicate the ListView is not in sync with my changes. Lately this crash happens 100% of the time under the simulator.

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

View 8 Replies View Related

Android :: ListAdapter - Cursor - Custom Layout?

Oct 12, 2010

I'm experimenting with the Android platform, and I'm beginning to love it, but right now I'm stuck, at this cursor/list adapter problem-thing.

The thing is, that I request a function, returning a data object, with several properties I'd like to map to different TextView's.

My list_item.xml

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

So what I would like to do is: Map a property of an array of objects to several fields in the file.

View 1 Replies View Related

Android :: ListView And Selected Items With A Custom ListAdapter

Oct 13, 2010

Android has ListView component which is quite nice. The problem is that I created my own adapter to supply viewitems for each item displayed and I don't get anymore: Background color change when i scroll the items using up/down arrows. Background color change when I select an item. How do I do that?

View 1 Replies View Related

Android :: Launch My App - It Crashes With OutOfMemory Exception

Aug 24, 2010

I have an Android app that in the onCreate() method, preloads a lot of graphics.

When I test my app on my HTC Aria and launch it, it runs fine. However, if I press the back button to exit my app, and then launch the app again, it crashes with an OutOfMemoryError: bitmap size exceeds VM budget. If I then launch the app for the third time (right after it has crashed) it launches fine. Then if I close and re-launch it, it crashes again with out of memory. It continues this every-other-time-crashing pattern forever if I keep trying.

I checked to see what life cycle methods were being called and onStop() and onDestroy() are both being called when I exit the app, yet I have a feeling that something is not yet being cleaned up and that by "crashing" the app when I try to launch it the second time, it somehow free's the memory.

Any thoughts on what could be happening or how to remedy this? Please let me know if you need me to post more info.

Info: My app is fairly simple and only has 1 activity that plays some frame animations.

View 3 Replies View Related

Android : Stock 2.1 Browser Always Crashes On First Launch

Jun 19, 2010

I tried changing the homepage, but it still crashes. Ever since upgrading to 2.1 OTA, the browser has always seemed to crash on first load. Launching the browser a second time brings it back up instantly. It's rather annoying. Anyone else notice this? Is there a tweak/change available to try?

View 2 Replies View Related

Android :: Extending SimpleCursorAdapter With A Custom GetViewBinder

Oct 31, 2010

Im using the NotePad example as a base for an application. This binds a ListActivity to a Provider.

Its perfect, except it uses SimpleCursorAdaptor, which means the list only binds to and displays one item per row. I want it to display two items, both bound the Provider. Or more accurately display the text from one Content Provider field and an icon which depends on the value of a different field.

This sounds like a pretty simple thing to do, a very slight modification to the NotePad application. Trouble is, I have no idea on *how* to do it. I really need a starting point, and "approach" to use.

So far I have tried (unsuccessfully):

* Hand populating the ListView by reading in the Provider data and populating an array in OnCreate. This works, except as the data is not bound the List does not update when I add an item.

* Extending SimpleCursorAdapter with a custom getViewBinder. Could still only bind to a single column.

* Building my own ListAdaptor. Couldn't get this to work.

* Concatenating both fileds together and "parsing" 2 fields into 1 field read/write.

The next thing I will try is extremely tacky running two separate simpleCursorAdaptors in two views in a Linear Layout, fudged so the row height is identical, and duplicate the logic.

I say this only to show that I really, really have tried.

How I can create a custom CursorAdaptor which binds to two fields instead of just one like SimpleCursorAdapter?

View 4 Replies View Related

HTC EVO 4G :: Youtube Crashes Upon Launch / Sort It Out?

Jun 27, 2010

For the first few weeks youtube worked fine on my evo. The past week anytime I try to either use the youtube app or play a youtube video it shows a black screen for a split second and then closes immediately. Anyone else have this problem? I wish I could just uninstall/reinstall the youtube app but I don't think you can do that.

View 6 Replies View Related

HTC Eris :: Browser Crashes On Launch - XtrSense

Oct 31, 2010

My stock browser used to crash immediately upon launch, no matter where it was being launched from. So I always have to start the browser twice.

But I recently rooted and went with xtrSense. At first it all seemed smoother, but after a few days, it's back to crashing on launch again. Once I re-launch, it seems to work fine, but this is still a hassle.

Thought rooting would b my magic "fix-all".

View 3 Replies View Related

General :: App Crashes Immediately After Launch On Phone

Apr 6, 2013

I have just made a small testing app, soon to be a notes app, and I am experimenting with a listview control. However, it does not work and I get an 'Unfortunately, Notes has stopped' message when I open it on my Sony Xperia tipo. Here is the code for it: MainActivity.java

Code:
package com.tapinteractive.holonotes;
import com.tapinteractive.holonotes.R;
import android.os.Bundle;
import android.app.Activity;
[code]...

View 9 Replies View Related

Android :: Extending Application Class And Broadcast Receivers

Nov 1, 2010

In a book I read, the author suggests to extend the application class in order to have a place to be used as a singleton. In this way, it is easy to make some initialization stuff in it onCreate().Now my question: if my application has also some broadcast receivers declared in the manifest, and the application was not started explicitly, or it was but then the os reclaimed it resources back, what will be happening if the broadcast receiver is triggered? Will the onCreate of the application class be called first?

View 7 Replies View Related

Android :: Custom View Extending View-Class / Still Based On XML-Layout

Aug 17, 2010

I want to build my own custom view which should look like the Crysis-GUI.At first I designed a XML-based Layout and made it visible via the setContentView(int resid)-Method. Worked pretty well.But now I wan't to go a step further and draw in my Layout. So I created a new Class, let it extend View and overrode the onDraw()-Method. So far so good.But how can I still use my XML-Layout? I can't do setContentView anymore, so how could the same effect be achieved?

View 1 Replies View Related

Android :: Gridview In Custom Dialog Not Working / Crashes / Fix It

Sep 5, 2010

I have tried adding a grid view to a custom dialog. When displaying the dialog it crashes. But when tried displaying the grid view in normal activity it was working.( without dialog )

I took the examples from developer android website.Took grid view and tried to integrate in custom dialog.

I used two xml main.xml & category.xml. Here is my code...

View 2 Replies View Related

Android :: Custom List Cursor Adaptor Crashes At BindView On Emulator - Not On Phone

Aug 23, 2010

I will try to be specific if I can - please be patient, first time asker and relatively new to programming on this platform. Apologies if this has been asked/answered before - please link it to me. I have searched up and down but find other unrelated (to me at least) problems.

The real puzzler for me is that my app is crashing on my emulator but when installed on my phone (via upload of apk to phone and then using an AppInstaller app from market) it works.

The crash comes from a NullPointerException at the numbered line in the following code snippet (my code) of a custom list cursor adapter.

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

The following error dump is created.

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

Curiously I have been happily programming and debugging away all day and out of the blue a long working and bug free portion of my app now throws up this error.

I suspect it might be a problem with the databases, but really not sure - nothing seems out of place there. Up until today I had a database with only one table - today I added a new table which also has a "_id" field as the name autoincrement key field, which I read in the docs was required for android list adapters (if memory serves). Having some experience in coding and some minor experience with databases, that seems like a bad idea to me but I am uncertain of if that is the problem and/or how else to do it.

The crash I am listing here does not display or make reference to the data in the other, new table. The cursor does not contain any query data from it. In fact if I rename the key field "_id" of the new table to something else (ie "_blah"), the crash remains.

Like I said, if I upload the apk to my phone, it works.

I have tried the following on the emulator:
- restarting adb (and eclipse) - no result
- uninstall from emulator - no result
- destory AVD profile and recreate - no result

I am developing this under the Android 2.1 SDK, and have been for the last few weeks. I have only ever had that SDK installed, I am yet to update to 2.2.

Not sure what else I can say here - hoping somebody here has experience enough to shed some light on it.

Without a fix to this, I can anticipate a very slow development process here on out (assuming I have to upload to my phone to test new code changes...).

View 3 Replies View Related

Android :: Application Crashes Before It Starts

Nov 16, 2010

intentTest.java:
package intentTest.xyz.com;
import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.Button
public class intentTest extends Activity {
Button b;
/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
b = (Button) findViewById(R.id.b);
b.setOnClickListener( new View.OnClickListener() {
public void onClick(View view) {
Intent intent = new Intent(intentTest.this,seond.class );
startActivity(intent);
}});
}}
main.xml:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
>
<TextView
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="First screen"
/>
<Button
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="click"
android:name="@+id/b"
/>
</LinearLayout>
seond.java:
package intentTest.xyz.com;
import android.app.Activity;
import android.os.Bundle;
public class seond extends Activity{
/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.second);
} }
second.xml:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="wrap_content"
android:layout_height="wrap_content">
<TextView
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="second screen"
/>

manifest.xml:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="intentTest.xyz.com"
android:versionCode="1"
android:versionName="1.0">
<application android:icon="@drawable/icon" android:label="@string/app_name">
<activity android:name=".intentTest"
android:label="@string/app_name">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity android:name=".seond"></activity>
</application>
</manifest>

I get the following error code:
11-16 01:26:07.156: ERROR/AndroidRuntime(779): Uncaught handler: thread main exiting due to uncaught exception
11-16 01:26:07.166: ERROR/AndroidRuntime(779): java.lang.RuntimeException: Unable to start activity ComponentInfo{intentTest.xyz.com/intentTest.xyz.com.intentTest}: java.lang.NullPointerException
11-16 01:26:07.166: ERROR/AndroidRuntime(779):
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2401)
11-16 01:26:07.166: ERROR/AndroidRuntime(779):
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2417)
11-16 01:26:07.166: ERROR/AndroidRuntime(779):
at android.app.ActivityThread.access$2100(ActivityThread.java:116)
11-16 01:26:07.166: ERROR/AndroidRuntime(779):
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1794)
11-16 01:26:07.166: ERROR/AndroidRuntime(779):
at android.os.Handler.dispatchMessage(Handler.java:99)
11-16 01:26:07.166: ERROR/AndroidRuntime(779):
at android.os.Looper.loop(Looper.java:123)
11-16 01:26:07.166: ERROR/AndroidRuntime(779):
at android.app.ActivityThread.main(ActivityThread.java:4203)
11-16 01:26:07.166: ERROR/AndroidRuntime(779):
at java.lang.reflect.Method.invokeNative(Native Method)
11-16 01:26:07.166: ERROR/AndroidRuntime(779):
at java.lang.reflect.Method.invoke(Method.java:521)
11-16 01:26:07.166: ERROR/AndroidRuntime(779):
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:791)
11-16 01:26:07.166: ERROR/AndroidRuntime(779):
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:549)
11-16 01:26:07.166: ERROR/AndroidRuntime(779):
at dalvik.system.NativeStart.main(Native Method)
11-16 01:26:07.166: ERROR/AndroidRuntime(779): Caused by: java.lang.NullPointerException
11-16 01:26:07.166: ERROR/AndroidRuntime(779):
at intentTest.xyz.com.intentTest.onCreate(intentTest.java:18)
11-16 01:26:07.166: ERROR/AndroidRuntime(779):
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1123)
11-16 01:26:07.166: ERROR/AndroidRuntime(779):
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2364)
11-16 01:26:07.166: ERROR/AndroidRuntime(779):
... 11 more

View 5 Replies View Related

Android :: Use Map In My Application - Crashes With Error

Dec 7, 2009

I want to use a map in my application but I can't get it to run.

It always crashes with the following error:

CODE:.....

My XML file:

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

My layout:

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

In my code I add the map like this:

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

View 5 Replies View Related

Android :: AlertDialog Crashes Application / Why Is So?

Jun 17, 2010

Can someone explain to me why this AlertDialog crashes? code...

View 1 Replies View Related

Android :: Toast Crashes Application / What To Do?

Nov 19, 2010

In my application I've implemented such that pressing the hardware volume keys displays a Toast with the current volume. Things go well most of the times. However long presses of the volume keys do succeed in crashing my application. The Log generated on crash is the following...

The approach I follow:
I have a toast Object and for every key press event detected I inflate a view ,set the view elements within, set it to the toast and then show the toast.

Any idea what is going wrong ? code...

View 1 Replies View Related

Android :: Application Crashes When Orientation Changes - Fix It?

May 26, 2010

My app crashes when the device orientation changes..Tried debugging on real device, but I have no clue where the crash exactly happens.. I would appreciate if someone could throw some light on this:

Below is the error log...

View 2 Replies View Related

Android :: Droid Application Crashes / What To Do?

Jan 18, 2010

I am trying to run an application on an android emulator, but it crashes. i am following a howto

i don't know what to do, it just crashes. other applications are running fine, can anyone tell me what i am doing wrong.here is the code...

View 4 Replies View Related

Android :: Camera Application Preview Crashes

Nov 24, 2010

So I started with this little write-up. I wanted to try to make an application that will take pictures while running in the background. To start though I wanted an application that once opened would simply take a picture every X seconds. After recreating the classes and methods show in the walk through below I ran into a few problems.
http://itp.nyu.edu/~sve204/mobilemedia_spring10/androidCamera101.pdf

For starters its seems that the onCreate function sets up all the objects for the application, but if you try to take a picture through any other method than onClick (IE directly calling it) the application actually hasn't setup the canvas or the preview yet.

My first question:
Is there any conditional method that you can setup that will wait till all the "onCreate" objects are created and their associated methods are called and finished? How do I wait for the application to finish putting together my surface and starting the cameras preview before automatically starting to take pictures?

My second question:
I am required to have a preview available to take pictures. Is there anyway to push this application to the back (IE running in the background) while still taking pictures? Is drawing to a canvas a requirement? (From what I can tell AFAIK, you are required to have a surfaceholder to start preview, when you put up another screen or application that pauses the current application and closes the surface/canvas you were presenting that preview on). If my understanding is correct on all of this the best I will be able to do is make a 1x1 pixel canvas that will still take up the screen due to the application being in the foreground.

My Third question:
Is there any way around this? Can you still utilize the camera in some fashion without requiring the preview be drawn?

View 1 Replies View Related

Android :: Camera Flash In 1.5 And 1.6 - Application Crashes

May 21, 2010

My app is using the camera on the phone. For phones w/ 2.0+ I have been able to activate the Flash. When I test on a phone with 1.5 OS on it the app crashes. I get: java.lang.reflect.InvocationTargetException and the Cause is java.lang.VerifyError: fishers.Nav.TakePicture$1
I assume because you have to access the flash differently in apps below 2.0? Can anyone give me some advice or links to examples showing how I could make it work over the whole range of Operating System version or is that just not at all do-able?

View 5 Replies View Related

Android :: Application Crashes When Trying To Play Media

Nov 11, 2010

I have a small mp3 (326KB) in my res/raw folder. In my code, I have mPlayer = MediaPlayer.create(FakeCallScreen.this, R.raw.sample); Player.prepare(); mPlayer.start(); The application just crashes when it tries to start the activity, I cannot figure out why.

View 2 Replies View Related

Android :: Application Crashes On Device Boot

Sep 20, 2010

I have registered a Receiver component for ON_BOOT_COMPLETED broadcast, in my application. The receiver does just prints a line in its onReceive() callback. However, when I boot the emulator(by executing Run as->Android application command from Eclipse) and unlock the screen on start up, I get an ANR dialog displayed in my Application. Following are the exceptions logged:

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

View 4 Replies View Related

Android :: Droid Application Crashes / What I Am Doing Wrong?

Jan 18, 2010

I am very new to android programming. i was following a guide in here, to create an application that shows the current location, i did as was told in the guide, but whenever i try to run it, it crashes, and asks for "force Close",
does somebody know what i am doing wrong? here is the code....

View 2 Replies View Related

Android : Launch Browser Intent With Custom Class - Cannot Find Activity

Jul 25, 2010

I want to specifically run the default Android browser for a given URL. I'm using this code: I also tried adding <uses-library android:name="com.google.android.browser" /> to the manifest. Am I missing something here? PS: I'm not interested in using startActivity(new Intent(Intent.ACTION_VIEW, Uri.parse("http://www.google.com"))) as it will list all the choices for the browsing Intent.

View 3 Replies View Related

Android :: Playing Multiple Sounds - Application Crashes

Jun 14, 2010

Shown are a few lines of code. If I play a single sound, it runs fine. Adding a second sound causes it to crash.

private SoundManager mSoundManager;
/** Called when the activity is first created. */
@Override public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState); setContentView(R.layout.sos);
mSoundManager = new SoundManager(); mSoundManager.initSounds(getBaseContext());
mSoundManager.addSound(1,R.raw.dit); mSoundManager.addSound(1,R.raw.dah);
Button SoundButton = (Button)findViewById(R.id.SoundButton);
SoundButton.setOnClickListener(new OnClickListener() {
public void onClick(View v) { mSoundManager.playSound(1);
mSoundManager.playSound(2); } } ); }

View 1 Replies View Related

Android :: Droid Application Crashes When Button Is Clicked / Fix It?

Oct 19, 2010

I am writing an android application that check the username and the password of the user once a login button is clicked

i run the app in the emulator and when i click on login button the application is crashed code...

View 1 Replies View Related







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