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. ANN: 0xlab's customized GNU Toolchain for Android (2010-11-0)

Hello list,

0xlab is glad to inform you of the latest customized GNU Toolchain for Android.

The prebuilt packages:
    http://downloads.0xlab.org/toolchain/armv5te/

Combination:
 * gcc-4.4.4 + Google/0xlab patches
 * binutils-2.19 + Google patches + gold linker
 * gdb-7.1 + Google patches

with ppl + cloog enabled.
source tree and toolchain builder:
    http://gitorious.org/android-toolchain

# arm-eabi-gcc -v
Using built-in specs.
Target: arm-eabi
Configured with: .././../gcc/gcc-4.4.4/configure --prefix=/opt/android
--target=arm-eabi --host=i686-unknown-linux-gnu
--build=i686-unknown-linux-gnu --enable-languages=c,c++ --enable-gold
--with-pkgversion='0xlab 2010.11-0'
--with-gmp=/home/jserv/0xlab-toolchain/build/temp-install
--with-mpfr=/home/jserv/0xlab-toolchain/build/temp-install
--with-ppl=/home/jserv/0xlab-toolchain/build/temp-install
--with-cloog=/home/jserv/0xlab-toolchain/build/temp-install
--disable-libssp --enable-threads --disable-nls --disable-libmudflap
--disable-libgomp --disable-libstdc__-v3 --disable-sjlj-exceptions
--disable-shared --disable-tls --enable-gold --with-float=soft
--with-fpu=vfp --with-arch=armv5te --enable-target-optspace
--with-abi=aapcs --prefix=/opt/android --disable-docs --disable-nls
--with-gcc-version=4.4.4 --with-binutils-version=2.19
--with-arch=armv5te
--with-sysroot=/home/jserv/android-toolchain/sysroot
--with-gmp-version=4.2.4 --with-mpfr-version=2.4.1
--with-gdb-version=7.1.x
--with-multilib-list=mthumb-interwork,mandroid
--program-transform-name='s&^&arm-eabi-&'
Thread model: single
gcc version 4.4.4 (0xlab 2010.11-0)

0xlab is about to migrate to Linaro Toolchain as the base.

Sincerely,
Jim Huang (jserv)
http://0xlab.org/

-- 
unsubscribe: android-porting+unsubscr...@googlegroups.com
website: 

2. Review Android GPS Phone Garminasus A10, The Best Of Both Sides 8 November 2010

Starred...nice inpoh, thanks...sol


http://mantugaul.wordpress.com/2010/11/08/review-android-gps-phone-garminasus-a10-the-best-of-both-sides/

-- 
===============
"Indonesian Android Community [id-android]"

PING'S mobile
Email: sa...@pings-mobile.com  Ph. (021) 96087100
---------------------
Yopie Ratjoen
Email: yo...@ratjoen.com  Ph. 08977726681
--------------------
Gila original
Email: i...@gilaoriginal.com  Ph. (031) 91555898
--------------------

Aturan Jual/Kloteran ID-Android  http://goo.gl/azW7

3. wish to join you

4. I don't get any event such as onResume, onStart when the screen is turned on

5. Review Internet Indosat M2 VS Telkomsel Flash Unlimited 16 November 2010

6. alsa drivers on froyo

7. Paging Suhu Androider Pontianak