Button into a Tab error of xml

by Dayn » Wed, 29 Jul 2009 22:22:46 GMT


Sponsored Links
 i

I try to add buttons into a tab, but when I run my code. there are en
error in android emulator.

I think my xml file is wrong because it's designed it out of (height
and width) tab but I don't find how to add that into a tab without
error.

my code :

package m.dany.anrdoid.inertfacegraphiquevvm;

import android.app.TabActivity;
import android.content.Intent;
import android.os.Bundle;
import android.widget.Button;
import android.widget.TabHost;
import android.widget.TabHost.TabSpec;

public class InerfaceGraphiqueVVM extends TabActivity {

/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
//setContentView(R.layout.main);

setContentView(R.layout.tab);

final TabHost oTabHost = getTabHost();

TabSpec ts1 = oTabHost.newTabSpec("tab1");
ts1.setIndicator("Voicemail");
ts1.setContent(new Intent(this, Tab1.class));
oTabHost.addTab(ts1);

TabSpec ts2 = oTabHost.newTabSpec("tab2");
ts2.setIndicator("TAB 2");
ts2.setContent(R.id.textview2);
oTabHost.addTab(ts2);

oTabHost.setCurrentTab(0);

}
}


the xml file fot tab and following by xml file for button :


here:

<?xml version="1.0" encoding="utf-8"?>

<TabHost xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@android:id/tabhost"
android:layout_width="fill_parent"
android:layout_height="fill_parent">

<LinearLayout
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent">

<TabWidget
android:id="@android:id/tabs"
android:layout_width="fill_parent"
android:layout_height="wrap_content" />
<FrameLayout
android:id="@android:id/tabcontent"
android:layout_width="fill_parent"
android:layout_height="fill_parent">

<TextView
android:id="@+id/textview1"
android:layout_width="fill_parent"
android:layout_height="fill_parent" />

<TextView
android:id="@+id/textview2"
android:layout_width="fill_parent"
android:layout_height="fill_parent" />

</FrameLayout>
</LinearLayout>
</TabHost>



and here:


<?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">

<Button
android:id="@+id/button"
android:text="Button">
android:layout_width="wrap_content"
android:layout_height="wrap_content"
</Button>

</LinearLayout>

Android Emulator has an error .

I'm really blocked so what the matter ?? please !

T



Button into a Tab error of xml

by Mark Murphy » Wed, 29 Jul 2009 23:17:51 GMT


 


And the error is...what?

-- 
Mark Murphy (a Commons Guy)
 http://commonsware.com  |  http://twitter.com/commonsguy 

Android 1.5 Programming Books:  http://commonsware.com/books.html 

--~--~---------~--~----~------------~-------~--~----~


Sponsored Links


Button into a Tab error of xml

by Dany BREARD » Wed, 29 Jul 2009 23:22:58 GMT


 he error is

emulator dislpay:

the application interface graphique has stopped unexpectedly , please try again.

in DDMS we can watch:


-29 15:19:15.558: INFO/ActivityManager(568): Start proc
m.dany.anrdoid.inertfacegraphiquevvm for activity
m.dany.anrdoid.inertfacegraphiquevvm/.InerfaceGraphiqueVVM: pid=1633 uid=10021
gids={}
07-29 15:19:15.757: DEBUG/dalvikvm(1626): LinearAlloc 0x0 used 637060 of
4194304 (15%)
07-29 15:19:16.828: DEBUG/AndroidRuntime(1633): Shutting down VM
07-29 15:19:16.828: WARN/dalvikvm(1633): threadid=3: thread exiting with
uncaught exception (group=0x4000fe70)
07-29 15:19:16.838: ERROR/AndroidRuntime(1633): Uncaught handler: thread main
exiting due to uncaught exception
07-29 15:19:16.878: ERROR/AndroidRuntime(1633): java.lang.RuntimeException:
Unable to start activity
ComponentInfo{m.dany.anrdoid.inertfacegraphiquevvm/m.dany.anrdoid.inertfacegraphiquevvm.InerfaceGraphiqueVVM}:
android.content.ActivityNotFoundException: Unable to find explicit activity
class
{m.dany.anrdoid.inertfacegraphiquevvm/m.dany.anrdoid.inertfacegraphiquevvm.Tab1};
have you declared this activity in your AndroidManifest.xml?
07-29 15:19:16.878: ERROR/AndroidRuntime(1633): at
android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2268)
07-29 15:19:16.878: ERROR/AndroidRuntime(1633): at
android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2284)
07-29 15:19:16.878: ERROR/AndroidRuntime(1633): at
android.app.ActivityThread.access$1800(ActivityThread.java:112)
07-29 15:19:16.878: ERROR/AndroidRuntime(1633): at
android.app.ActivityThread$H.handleMessage(ActivityThread.java:1692)
07-29 15:19:16.878: ERROR/AndroidRuntime(1633): at
android.os.Handler.dispatchMessage(Handler.java:99)
07-29 15:19:16.878: ERROR/AndroidRuntime(1633): at
android.os.Looper.loop(Looper.java:123)
07-29 15:19:16.878: ERROR/AndroidRuntime(1633): at
android.app.ActivityThread.main(ActivityThread.java:3948)
07-29 15:19:16.878: ERROR/AndroidRuntime(1633): at
java.lang.reflect.Method.invokeNative(Native Method)
07-29 15:19:16.878: ERROR/AndroidRuntime(1633): at
java.lang.reflect.Method.invoke(Method.java:521)
07-29 15:19:16.878: ERROR/AndroidRuntime(1633): at
com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:782)
07-29 15:19:16.878: ERROR/AndroidRuntime(1633): at
com.android.internal.os.ZygoteInit.main(ZygoteInit.java:540)
07-29 15:19:16.878: ERROR/AndroidRuntime(1633): at
dalvik.system.NativeStart.main(Native Method)
07-29 15:19:16.878: ERROR/AndroidRuntime(1633): Caused by:
android.content.ActivityNotFoundException: Unable to find explicit activity
class
{m.dany.anrdoid.inertfacegraphiquevvm/m.dany.anrdoid.inertfacegraphiquevvm.Tab1};
have you declared this activity in your AndroidManifest.xml?
07-29 15:19:16.878: ERROR/AndroidRuntime(1633): at
android.app.Instrumentation.checkStartActivityResult(Instrumentation.java:1480)
07-29 15:19:16.878: ERROR/AndroidRuntime(1633): at
android.app.ActivityThread.resolveActivityInfo(ActivityThread.java:2072)
07-29 15:19:16.878: ERROR/AndroidRuntime(1633): at
android.app.LocalActivityManager.startActivity(LocalActivityManager.java:277)
07-29 15:19:16.878: ERROR/AndroidRuntime(1633): at
android.widget.TabHost$IntentContentStrategy.getContentView(TabHost.java:600)
07-29 15:19:16.878: ERROR/AndroidRuntime(1633): at
android.wi



Button into a Tab error of xml

by Mark Murphy » Wed, 29 Jul 2009 23:29:03 GMT


 


07-29 15:19:16.878: ERROR/AndroidRuntime(1633):
java.lang.RuntimeException: Unable to start activity
ComponentInfo{m.dany.anrdoid.inertfacegraphiquevvm/m.dany.anrdoid.inertfacegraphiquevvm.InerfaceGraphiqueVVM}:
android.content.ActivityNotFoundException: Unable to find explicit
activity class
{m.dany.anrdoid.inertfacegraphiquevvm/m.dany.anrdoid.inertfacegraphiquevvm.Tab1};
have you declared this activity in your AndroidManifest.xml?

That seems fairly self-explanatory. Have you declared this activity in
your AndroidManifest.xml?

-- 
Mark Murphy (a Commons Guy)
 http://commonsware.com  |  http://twitter.com/commonsguy 

Android 1.5 Programming Books:  http://commonsware.com/books.html 

--~--~---------~--~----~------------~-------~--~----~



Button into a Tab error of xml

by Dany BREARD » Thu, 30 Jul 2009 15:49:27 GMT


 Hi murphy

Thank you so much, I add my new acctivity class Tab1 in the AndroidManifest.xml 
file. And now my code can launch in android;

I blocked since monday about that.

you are my hero lol.

I think is a novice error. But if I you don't find this error you can't go 
ahead.

Thanks murphy 

see you later 

Dany BREARD a French novice android develloper





_________________________________________________________________
Indit ! Des Emoticnes Djantes! Installez les dans votre Messenger !
 http://www.ilovemessenger.fr/Emoticones/EmoticonesDejantees.aspx 
--~--~---------~--~----~------------~-------~--~----~



Other Threads

1. Exception from setupwizard(android.setupwizard.AccountIntroActivity

Hello All,

Sometimes when i try to use login am gettign the below exception, but kinda
clue less, have any one faced this?

*just happens with setupwizard..

06-01 12:07:01.923 E/Checkin ( 1996): Error reporting crash
06-01 12:07:01.923 E/Checkin ( 1996): Crash logging skipped, too soon after
logging failure
06-01 12:07:01.958 E/AndroidRuntime( 3990): java.lang.RuntimeException:
Unable to resume activity
{com.android.setupwizard/com.android.setupwizard.AccountIntroActivity}:
android.database.sqlite.SQLiteException: no such table: events
06-01 12:07:01.958 E/AndroidRuntime( 3990):     at
android.app.ActivityThread.performResumeActivity(ActivityThread.java:2950)
06-01 12:07:01.958 E/AndroidRuntime( 3990):     at
android.app.ActivityThread.handleResumeActivity(ActivityThread.java:2965)
06-01 12:07:01.958 E/AndroidRuntime( 3990):     at
android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2516)
06-01 12:07:01.958 E/AndroidRuntime( 3990):     at
android.app.ActivityThread.access$2200(ActivityThread.java:119)
06-01 12:07:01.958 E/AndroidRuntime( 3990):     at
android.app.ActivityThread$H.handleMessage(ActivityThread.java:1863)
06-01 12:07:01.958 E/AndroidRuntime( 3990):     at
android.os.Handler.dispatchMessage(Handler.java:99)
06-01 12:07:01.958 E/AndroidRuntime( 3990):     at
android.os.Looper.loop(Looper.java:123)
06-01 12:07:01.958 E/AndroidRuntime( 3990):     at
android.app.ActivityThread.main(ActivityThread.java:4363)
06-01 12:07:01.958 E/AndroidRuntime( 3990):     at
java.lang.reflect.Method.invokeNative(Native Method)
06-01 12:07:01.958 E/AndroidRuntime( 3990):     at
java.lang.reflect.Method.invoke(Method.java:521)
06-01 12:07:01.958 E/AndroidRuntime( 3990):     at
com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:862)
06-01 12:07:01.958 E/AndroidRuntime( 3990):     at
com.android.internal.os.ZygoteInit.main(ZygoteInit.java:620)
06-01 12:07:01.958 E/AndroidRuntime( 3990):     at
dalvik.system.NativeStart.main(Native Method)
06-01 12:07:01.958 E/AndroidRuntime( 3990): Caused by:
android.database.sqlite.SQLiteException: no such table: events
06-01 12:07:01.958 E/AndroidRuntime( 3990):     at
android.database.DatabaseUtils.readExceptionFromParcel(DatabaseUtils.java:158)
06-01 12:07:01.958 E/AndroidRuntime( 3990):     at
android.database.DatabaseUtils.readExceptionFromParcel(DatabaseUtils.java:114)
06-01 12:07:01.958 E/AndroidRuntime( 3990):     at
android.database.BulkCursorProxy.count(BulkCursorNative.java:255)
06-01 12:07:01.958 E/AndroidRuntime( 3990):     at
android.database.BulkCursorToCursorAdaptor.set(BulkCursorToCursorAdaptor.java:44)
06-01 12:07:01.958 E/AndroidRuntime( 3990):     at
android.content.ContentProviderProxy.query(ContentProviderNative.java:351)
06-01 12:07:01.958 E/AndroidRuntime( 3990):     at
android.content.ContentResolver.query(ContentResolver.java:203)
06-01 12:07:01.958 E/AndroidRuntime( 3990):     at
com.android.setupwizard.NetworkMonitor$2.onChange(NetworkMonitor.java:181)
06-01 12:07:01.958 E/AndroidRuntime( 3990):     at
com.android.setupwizard.NetworkMonitor.<init>(NetworkMonitor.java:105)
06-01 12:07:01.958 E/AndroidRuntime( 3990):     at
com.android.setupwizard.NetworkMonitoringActivity.onResume(NetworkMonitoringActivity.java:111)
06-01 12:07:01.958 E/AndroidRuntime( 3990):     at
android.app.Instrumentation.callActivityOnResume(Instrumentation.java:1149)
06-01 12:07:01.958 E/AndroidRuntime( 3990):     at
android.app.Activity.performResume(Activity.java:3772)
06-01 12:07:01.958 E/AndroidRuntime( 3990):     at
android.app.ActivityThread.performResumeActivity(ActivityThread.java:2937)
06-01 12:07:01.958 E/AndroidRuntime( 3990):     ... 12 more

Any help appreciated

Thanks
Steve

-- 

2. SIGSEGV in "system_server"

This is a strange one.  I'm not filing as a bug yet because I've not
come up with an easy way to reproduce it (my full application can do
this consistently, but it's not exactly a lightweight test case).

The application I wrote HTTP POSTs a file to a remote web server.  If,
during this upload the phone is going through a lot of other activity
- applications being opened, closed, switched; notification drawer
being opened and closed - the whole phone shuts off with this error.
It seems to me that this could be a bug in the Android OS.  I thought
I'd run the error message past the list to see if this is worth
putting together a test case for and filing it with the Android
developers.

Thanks!


05-28 10:51:19.504: INFO/DEBUG(2585): *** *** *** *** *** *** *** ***
*** *** *** *** *** *** *** ***
05-28 10:51:19.512: INFO/DEBUG(2585): Build fingerprint: 'verizon/
voles/sholes/sholes:2.1-update1/ESE81/29593:user/release-keys'
05-28 10:51:19.519: INFO/DEBUG(2585): pid: 12748, tid: 12755  >>>
system_server <<<
05-28 10:51:19.527: INFO/DEBUG(2585): signal 11 (SIGSEGV), fault addr
deadbaad
05-28 10:51:19.527: INFO/DEBUG(2585):  r0 00000000  r1 afe13329  r2
00000027  r3 00000054
05-28 10:51:19.527: INFO/DEBUG(2585):  r4 afe3ae08  r5 00000000  r6
00000000  r7 4450f010
05-28 10:51:19.527: INFO/DEBUG(2585):  r8 40009408  r9 488cd000  10
00000018  fp 46e02a2c
05-28 10:51:19.527: INFO/DEBUG(2585):  ip 00002ed8  sp 46e02748  lr
deadbaad  pc afe109e0  cpsr 60000030
05-28 10:51:20.285: INFO/DEBUG(2585):          #00  pc 000109e0  /
system/lib/libc.so
05-28 10:51:20.285: INFO/DEBUG(2585):          #01  pc 00006f78  /
system/lib/libcutils.so
05-28 10:51:20.293: INFO/DEBUG(2585):          #02  pc 00044878  /
system/lib/libdvm.so
05-28 10:51:20.293: INFO/DEBUG(2585):          #03  pc 000170d8  /
system/lib/libdvm.so
05-28 10:51:20.293: INFO/DEBUG(2585):          #04  pc 00015a98  /
system/lib/libdvm.so
05-28 10:51:20.301: INFO/DEBUG(2585):          #05  pc 00015d94  /
system/lib/libdvm.so
05-28 10:51:20.301: INFO/DEBUG(2585):          #06  pc 00016ff4  /
system/lib/libdvm.so
05-28 10:51:20.301: INFO/DEBUG(2585):          #07  pc 000163a4  /
system/lib/libdvm.so
05-28 10:51:20.301: INFO/DEBUG(2585):          #08  pc 00016b60  /
system/lib/libdvm.so
05-28 10:51:20.301: INFO/DEBUG(2585):          #09  pc 00016ce0  /
system/lib/libdvm.so
05-28 10:51:20.301: INFO/DEBUG(2585):          #10  pc 00057b64  /
system/lib/libdvm.so
05-28 10:51:20.301: INFO/DEBUG(2585):          #11  pc 00057cc0  /
system/lib/libdvm.so
05-28 10:51:20.308: INFO/DEBUG(2585):          #12  pc 000430c2  /
system/lib/libdvm.so
05-28 10:51:20.308: INFO/DEBUG(2585):          #13  pc 00043160  /
system/lib/libdvm.so
05-28 10:51:20.308: INFO/DEBUG(2585):          #14  pc 00055c42  /
system/lib/libdvm.so
05-28 10:51:20.308: INFO/DEBUG(2585):          #15  pc 000139b8  /
system/lib/libdvm.so
05-28 10:51:20.308: INFO/DEBUG(2585):          #16  pc 00019338  /
system/lib/libdvm.so
05-28 10:51:20.308: INFO/DEBUG(2585):          #17  pc 00018804  /
system/lib/libdvm.so
05-28 10:51:20.308: INFO/DEBUG(2585):          #18  pc 0004eed0  /
system/lib/libdvm.so
05-28 10:51:20.316: INFO/DEBUG(2585):          #19  pc 0004eef8  /
system/lib/libdvm.so
05-28 10:51:20.316: INFO/DEBUG(2585):          #20  pc 0005c478  /
system/lib/libdvm.so
05-28 10:51:20.316: INFO/DEBUG(2585):          #21  pc 0005d116  /
system/lib/libdvm.so
05-28 10:51:20.316: INFO/DEBUG(2585):          #22  pc 0005d17c  /
system/lib/libdvm.so
05-28 10:51:20.316: INFO/DEBUG(2585):          #23  pc 00056d1e  /
system/lib/libdvm.so
05-28 10:51:20.316: INFO/DEBUG(2585):          #24  pc 000139b8  /
system/lib/libdvm.so
05-28 10:51:20.316: INFO/DEBUG(2585):          #25  pc 00019338  /
system/lib/libdvm.so
05-28 10:51:20.324: INFO/DEBUG(2585):          #26  pc 00018804  /
system/lib/libdvm.so
05-28 10:51:20.324: INFO/DEBUG(2585):          #27  pc 0004eed0  /
system/lib/libdvm.so
05-28 10:51:20.324: INFO/DEBUG(2585):          #28  pc 0004eef8  /
system/lib/libdvm.so
05-28 10:51:20.324: INFO/DEBUG(2585):          #29  pc 000426d4  /
system/lib/libdvm.so
05-28 10:51:20.324: INFO/DEBUG(2585):          #30  pc 0000fd74  /
system/lib/libc.so
05-28 10:51:20.324: INFO/DEBUG(2585):          #31  pc 0000f840  /
system/lib/libc.so
05-28 10:51:20.324: INFO/DEBUG(2585): code around pc:
05-28 10:51:20.324: INFO/DEBUG(2585): afe109d0 f8442001 4798000c
e054f8df 26002227
05-28 10:51:20.332: INFO/DEBUG(2585): afe109e0 2000f88e ef4cf7fb
f7fd2106 f04fe822
05-28 10:51:20.332: INFO/DEBUG(2585): afe109f0 91035180 460aa901
96012006 f7fc9602
05-28 10:51:20.332: INFO/DEBUG(2585): code around lr:
05-28 10:51:20.332: INFO/DEBUG(2585): deadba9c ffffffff ffffffff
ffffffff ffffffff
05-28 10:51:20.332: INFO/DEBUG(2585): deadbaac ffffffff ffffffff
ffffffff ffffffff
05-28 10:51:20.332: INFO/DEBUG(2585): deadbabc ffffffff ffffffff
ffffffff ffffffff
05-28 10:51:20.332: INFO/DEBUG(2585): stack:
05-28 10:51:20.332: INFO/DEBUG(2585):     46e02708  00000015
05-28 10:51:20.332: INFO/DEBUG(2585):     46e0270c  afe13359  /system/
lib/libc.so
05-28 10:51:20.332: INFO/DEBUG(2585):     46e02710  afe3b02c  /system/
lib/libc.so
05-28 10:51:20.332: INFO/DEBUG(2585):     46e02714  afe3afd8  /system/
lib/libc.so
05-28 10:51:20.332: INFO/DEBUG(2585):     46e02718  00000000
05-28 10:51:20.332: INFO/DEBUG(2585):     46e0271c  afe14373  /system/
lib/libc.so
05-28 10:51:20.332: INFO/DEBUG(2585):     46e02720  afe13329  /system/
lib/libc.so
05-28 10:51:20.332: INFO/DEBUG(2585):     46e02724  afe13329  /system/
lib/libc.so
05-28 10:51:20.332: INFO/DEBUG(2585):     46e02728  00000054
05-28 10:51:20.332: INFO/DEBUG(2585):     46e0272c  afe3ae08  /system/
lib/libc.so
05-28 10:51:20.340: INFO/DEBUG(2585):     46e02730  00000000
05-28 10:51:20.340: INFO/DEBUG(2585):     46e02734  46e0275c
05-28 10:51:20.340: INFO/DEBUG(2585):     46e02738  4450f010  /dev/
ashmem/mspace/dalvik-heap/2 (deleted)
05-28 10:51:20.340: INFO/DEBUG(2585):     46e0273c  afe135cb  /system/
lib/libc.so
05-28 10:51:20.340: INFO/DEBUG(2585):     46e02740  df002777
05-28 10:51:20.340: INFO/DEBUG(2585):     46e02744  e3a070ad
05-28 10:51:20.340: INFO/DEBUG(2585): #00 46e02748  46e026dc
05-28 10:51:20.340: INFO/DEBUG(2585):     46e0274c  ac029d20  /system/
lib/libskia.so
05-28 10:51:20.340: INFO/DEBUG(2585):     46e02750  00000170
05-28 10:51:20.340: INFO/DEBUG(2585):     46e02754  00000001
05-28 10:51:20.340: INFO/DEBUG(2585):     46e02758  0000000a
05-28 10:51:20.340: INFO/DEBUG(2585):     46e0275c  fffffbdf
05-28 10:51:20.340: INFO/DEBUG(2585):     46e02760  0010003b  [heap]
05-28 10:51:20.340: INFO/DEBUG(2585):     46e02764  400092e0  /dev/
ashmem/mspace/dalvik-heap/zygote/0 (deleted)
05-28 10:51:20.340: INFO/DEBUG(2585):     46e02768  449e4068  /dev/
ashmem/mspace/dalvik-heap/2 (deleted)
05-28 10:51:20.340: INFO/DEBUG(2585):     46e0276c  afb06f7b  /system/
lib/libcutils.so
05-28 10:51:20.340: INFO/DEBUG(2585): #01 46e02770  4450f018  /dev/
ashmem/mspace/dalvik-heap/2 (deleted)
05-28 10:51:20.340: INFO/DEBUG(2585):     46e02774  449e4068  /dev/
ashmem/mspace/dalvik-heap/2 (deleted)
05-28 10:51:20.340: INFO/DEBUG(2585):     46e02778  449e40c8  /dev/
ashmem/mspace/dalvik-heap/2 (deleted)
05-28 10:51:20.348: INFO/DEBUG(2585):     46e0277c  46e028d4
05-28 10:51:20.348: INFO/DEBUG(2585):     46e02780  400092e0  /dev/
ashmem/mspace/dalvik-heap/zygote/0 (deleted)
05-28 10:51:20.348: INFO/DEBUG(2585):     46e02784  449e4068  /dev/
ashmem/mspace/dalvik-heap/2 (deleted)
05-28 10:51:20.348: INFO/DEBUG(2585):     46e02788  00000068
05-28 10:51:20.348: INFO/DEBUG(2585):     46e0278c  ad04487b  /system/
lib/libdvm.so
05-28 10:51:25.707: INFO/DEBUG(2585): de{*filter*}d committing suicide to
free the zombie!

-- 

3. Playlist MP3 Android

4. Page resize on HD Devices like Nexus One

5. Google Map Key issue please help

6. How to send date from service to activity

7. Boosting Kinerja G1 Space internal hh di dream