Hello and thanks for the reply.  No, the FieldGuide line that is commented
out does not cause the crash.  To the contrary, it actually works properly
when starting that activity in the main app.  Below you are looking at the
code that causes the crash (the geotest activity).  I had all of the below
code in another application with other activities, and everytime I tried to
start this activity, it would crash.  So in an effort to isolate the
problem, I made a new Android project and put only the crashing activity in
it, and it is still crashing (which allows me to rule out the other
activites/code in the main app for causing the problem).  I get a
nullpointerexception when trying to start the activity (see logcat output
below).  I'm very curious if someone else copy/paste all the code below into
a new project, do they have the same problem?

-----Original Message-----
From: [email protected]
[mailto:[email protected]] On Behalf Of htbest2000
Sent: Thursday, September 03, 2009 5:52 AM
To: Android Beginners
Subject: [android-beginners] Re: startActivity crash


//startActivity(new Intent(Geotest.this, FieldGuide.class)); is this line
cause crash ?

why don't you show your layout file of FieldGuide?



On Sep 3, 7:33 am, "tinyang" <[email protected]> wrote:
> Hello.
>
> I have an application in which I am trying to start an activity 
> (geotest) in, and the activity crashes upon start of the application.  
> Below is my code and my logcat output.  I can't figure out the 
> problem, because I have several other activities I am able to start 
> exactly the same way with no problem.  When I compare the code, I 
> can't see what I'm doing wrong with the activity that crashes.  Am I 
> missing permissions for something maybe?  Can someone please help?
 Thanks!
> ----------------------------------------------------------------------
> ------
> ----------------------------------------------
>
> geotest.java:
>
> package net.tinyang.geotest;
>
> import android.app.Activity;
>
> //import android.content.Intent;
>
> import android.os.Bundle;
>
> import android.view.View;
>
> import android.widget.Button;
>
> import android.widget.Toast;
>
> public classgeotestextends Activity {
>
> Button geotagbtn = null;
>
> Button next2btn = null;
>
> @Override
>
> public void onCreate(Bundle savedInstanceState) {
>
> super.onCreate(savedInstanceState);
>
> geotagbtn = (Button) findViewById(R.id.geotagbtn);
>
> geotagbtn.setOnClickListener(new View.OnClickListener() {
>
> public void onClick(View v) {
>
> //startActivity(new Intent(MainMenu.this, TakePic.class));
>
> Toast.makeText(geotest.this, "Geotag Picture coming soon", 
> 5000).show();
>
> }
> });
>
> next2btn = (Button) findViewById(R.id.next2btn);
>
> next2btn.setOnClickListener(new View.OnClickListener() {
>
> public void onClick(View v) {
>
> //startActivity(new Intent(Geotest.this, FieldGuide.class));
>
> Toast.makeText(geotest.this, "Next coming soon", 5000).show();
>
> }
> });
> }
> }
>
> ----------------------------------------------------------------------
> ------
> --------------------------------------
>
> geotag.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:id="@+id/pictitle"
>
> android:layout_width="fill_parent"
>
> android:layout_height="wrap_content"
>
> android:layout_marginTop="10dip"
>
> android:text="Geotag your Picture" />
>
> <ImageView android:id="@+id/camsurface"
>
> android:layout_width="wrap_content"
>
> android:layout_height="wrap_content">
>
> </ImageView>
>
> <TableLayout
>
> android:layout_width="fill_parent"
>
> android:layout_height="wrap_content" >
>
> <TableRow>
>
> <Button android:id="@+id/geotagbtn"
>
> android:layout_width="wrap_content"
>
> android:layout_height="wrap_content"
>
> android:layout_below="@id/camsurface"
>
> android:layout_centerHorizontal="true"
>
> android:text=" Geotag " />
>
> <Button android:id="@+id/next2btn"
>
> android:layout_width="wrap_content"
>
> android:layout_height="wrap_content"
>
> android:layout_centerHorizontal="true"
>
> android:text=" Next " />
>
> </TableRow>
>
> </TableLayout>
>
> </LinearLayout>
>
> ----------------------------------------------------------------------
> ------
> -------------------------------------------------
>
> manifest:
>
> <?xml version="1.0" encoding="utf-8"?>
>
> <manifest xmlns:android="http://schemas.android.com/apk/res/android";
>
> package="net.tinyang.geotest"
>
> android:versionCode="1"
>
> android:versionName="1.0">
>
> <uses-permission android:name="android.permission.INTERNET" />
>
> <uses-permission android:name="android.permission.CAMERA"/>
>
> <application android:icon="@drawable/icon" 
> android:label="@string/app_name">
>
> <activity android:name=".geotest"
>
> android:label="@string/app_name">
>
> <intent-filter>
>
> <action android:name="android.intent.action.MAIN" />
>
> <category android:name="android.intent.category.LAUNCHER" />
>
> </intent-filter>
>
> </activity>
>
> </application>
>
> <uses-sdk android:minSdkVersion="2" />
>
> </manifest>
>
> ----------------------------------------------------------------------
> ------
> ---------------------------------------------------------------
>
> Logcat output:
>
> 09-02 23:14:42.623: ERROR/mountd(20): could not read initial mass 
> storage state
> 09-02 23:14:42.934: ERROR/flash_image(29): can't find recovery 
> partition
> 09-02 23:14:50.694: ERROR/MemoryHeapBase(52): error opening /dev/pmem: 
> No such file or directory
> 09-02 23:14:50.694: ERROR/SurfaceFlinger(52): Couldn't open 
> /sys/android_power/wait_for_fb_sleep or 
> /sys/android_power/wait_for_fb_wake
> 09-02 23:14:50.725: ERROR/GLLogger(52): couldn't load <libhgl.so> 
> library (Cannot find library)
> 09-02 23:14:50.805: ERROR/GLLogger(52): couldn't load <libhgl.so> 
> library (Cannot find library)
> 09-02 23:14:53.533: ERROR/BatteryService(52): Could not open 
> '/sys/class/power_supply/usb/online'
> 09-02 23:14:53.533: ERROR/BatteryService(52): Could not open 
> '/sys/class/power_supply/battery/batt_vol'
> 09-02 23:14:53.533: ERROR/BatteryService(52): Could not open 
> '/sys/class/power_supply/battery/batt_temp'
> 09-02 23:14:53.754: ERROR/EventHub(52): could not get driver version 
> for /dev/input/mouse0, Not a typewriter
> 09-02 23:14:53.754: ERROR/System(52): Failure starting core service
> 09-02 23:14:53.754: ERROR/System(52): java.lang.SecurityException
> 09-02 23:14:53.754: ERROR/System(52):     at 
> android.os.BinderProxy.transact(Native Method)
> 09-02 23:14:53.754: ERROR/System(52):     at
> android.os.ServiceManagerProxy.addService(ServiceManagerNative.java:14
> 6)
> 09-02 23:14:53.754: ERROR/System(52):     at
> android.os.ServiceManager.addService(ServiceManager.java:72)
> 09-02 23:14:53.754: ERROR/System(52):     at
> com.android.server.ServerThread.run(SystemServer.java:155)
> 09-02 23:14:53.764: ERROR/AndroidRuntime(52): Crash logging skipped, 
> no checkin service
> 09-02 23:14:53.783: ERROR/EventHub(52): could not get driver version 
> for /dev/input/mice, Not a typewriter
> 09-02 23:14:54.045: ERROR/SystemServer(52): Failure starting 
> StatusBarService
> 09-02 23:14:54.045: ERROR/SystemServer(52): 
> java.lang.NullPointerException
> 09-02 23:14:54.045: ERROR/SystemServer(52):     at 
> com.android.server.status.StatusBarPolicy.updateBluetooth(StatusBarPol
> icy.ja
> va:762)
> 09-02 23:14:54.045: ERROR/SystemServer(52):     at
> com.android.server.status.StatusBarPolicy.<init>(StatusBarPolicy.java:
> 285)
> 09-02 23:14:54.045: ERROR/SystemServer(52):     at
>
com.android.server.status.StatusBarPolicy.installIcons(StatusBarPolicy.java:
> 341)
> 09-02 23:14:54.045: ERROR/SystemServer(52):     at
> com.android.server.ServerThread.run(SystemServer.java:182)
> 09-02 23:14:54.055: ERROR/AndroidRuntime(52): Crash logging skipped, 
> no checkin service
> 09-02 23:14:54.295: ERROR/GpsLocationProvider(52): Could not open GPS 
> configuration file /etc/gps.conf
> 09-02 23:14:54.295: ERROR/GpsLocationProvider(52):
> java.io.FileNotFoundException: /etc/gps.conf
> 09-02 23:14:54.295: ERROR/GpsLocationProvider(52):     at
> org.apache.harmony.luni.platform.OSFileSystem.open(OSFileSystem.java:2
> 27)
> 09-02 23:14:54.295: ERROR/GpsLocationProvider(52):     at
> java.io.FileInputStream.<init>(FileInputStream.java:76)
> 09-02 23:14:54.295: ERROR/GpsLocationProvider(52):     at 
> com.android.internal.location.GpsLocationProvider.<init>(GpsLocationPr
> ovider
> .java:179)
> 09-02 23:14:54.295: ERROR/GpsLocationProvider(52):     at 
> com.android.server.LocationManagerService._loadProvidersNoSync(Locatio
> nManag
> erService.java:356)
> 09-02 23:14:54.295: ERROR/GpsLocationProvider(52):     at 
> com.android.server.LocationManagerService.loadProvidersNoSync(Location
> Manage
> rService.java:340)
> 09-02 23:14:54.295: ERROR/GpsLocationProvider(52):     at 
> com.android.server.LocationManagerService.loadProviders(LocationManage
> rServi
> ce.java:333)
> 09-02 23:14:54.295: ERROR/GpsLocationProvider(52):     at 
> com.android.server.LocationManagerService.<init>(LocationManagerServic
> e.java
> :447)
> 09-02 23:14:54.295: ERROR/GpsLocationProvider(52):     at
> com.android.server.ServerThread.run(SystemServer.java:235)
> 09-02 23:14:54.305: ERROR/AndroidRuntime(52): Crash logging skipped, 
> no checkin service
> 09-02 23:15:00.605: ERROR/dalvikvm(157): pthread_setspecific failed, 
> err=22
> 09-02 23:15:03.095: ERROR/NetworkStateTracker(52):
> net.tcp.buffersize.unknown not found in system properties. Using 
> defaults
> 09-02 23:15:03.095: ERROR/NetworkStateTracker(52): Can't set tcp 
> buffer
> sizes:java.io.FileNotFoundException: /sys/kernel/ipv4/tcp_rmem_min
>
> --
> :-)
> Teena
> P Please don't print this e-mail unless you really need to.
>
> Computer Problems?  Questions?  I can help!  Click on the link 
> below:http://www.crossloop.com/Teenah

No virus found in this incoming message.
Checked by AVG - http://www.avg.com
Version: 8.0.169 / Virus Database: 270.13.71/2332 - Release Date: 9/2/2009
6:03 PM


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google
Groups "Android Beginners" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-beginners?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to