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. Is SPP supported by Android BT API?

Hello,

I'm a little bit confused about supporting SPP by Android API(from
level 5).

As I understand it wasn't supported in versions before API level 5
what we can read in discussion below.(First Nick's post)

2. Fwd: [blrdroid] s please help me with these issues

---------- Forwarded message ----------
From: Aishwarya Deep Shukla <aishwaryashukl...@gmail.com>
Date: Tuesday, May 11, 2010
Subject: [blrdroid] someone please help me with these issues.
To: blrdroid-l...@meetup.com


1. I am using a Broadcast Receiver which acquires a static WakeLock,
then immediately starts an activity which starts a media player
instance inside its onCreate, at the last line of OnCreate i have
released the static wakelock which i had acquired in the
BroadCastReceiver. Everything seems to work fine, except for the fact
that the screen does wakeup but is locked and has to be manually
unlocked before the user can see my activity, though the media player
starts playing normally before itself. I have set
lockStatic=mgr.newWakeLock(PowerManager.FULL_WAKE_LOCK|
PowerManager.ACQUIRE_CAUSES_WAKEUP, LOCK_NAME_STATIC);
still the screen has to be manually unlocked before the user can see
the activity.
Any workaround?

2. I have used an EditText inside a tablelayout, tablerow and have set
the android:height and width to wrap_content, but still when i type on
the softkeypad it exceeds the bounds of the EditText Box and overflows
the screen too. have tried various properties on the EditText but none
of them seems to work.

3. I have an Activity a ListView Activity which populates the List
from a db. When the user clicks on an item in a list, i take him to a
new Activity from where he can also delete the item he selected. The
problem is that the Parent Activity's ListView is not refreshed and
continues showing redundant content, when i have finished the child
activity. I have tried making the cursor as static and calling
cursor.requery() from my child activity before i finish it, but it
doesnt seem to fix the issue.

4. I have used an Activity say activityA which sets up alarm using
AlarmManager.set to a Receiver say RecA. If i want to cancel this
alarm later from an Activity say ActivityB how do i do so?

Somone please respond to the above issues soon. I have been trying a
few workaounds since past few days, but am not able to fix these
issues.

Thanks in advance. :)




--
Please Note: If you hit "REPLY", your message will be sent to everyone
on this mailing list (blrdroid-l...@meetup.com)
http://www.meetup.com/android-baug/
This message was sent by Aishwarya Deep Shukla
(aishwaryashukl...@gmail.com) from The Bangalore Android User Group.
To learn more about Aishwarya Deep Shukla, visit his/her member
profile: http://www.meetup.com/android-baug/members/11415775/
To unsubscribe or to update your mailing list settings, click here:
http://www.meetup.com/android-baug/settings/
Meetup, PO Box 4668 #37895 New York, New York 10163-4668 | supp...@meetup.com

-- 

3. Button Image Resizing Problem

4. setOnClickListener doesnt work after a call to startActivity()...

5. EditTexts and ListViews

6. Displaying the ProgressDialog from the OpenGL thread.

7. Scamble a Bitmap image