Wednesday, February 5, 2014

Realize the label does not run


            
Console reported error:
 [2013-12-09 15:34:11 - icon] Automatic Target Mode: using existing emulator 'emulator-5554' running compatible AVD 'small' 
[2013-12-09 15:34:11 - icon] Uploading icon.apk onto device 'emulator-5554'
[2013-12-09 15:34:16 - icon] Installing icon.apk ...
[2013-12-09 15:34:26 - icon]! Success
[2013-12-09 15:34:27 - icon] Starting activity com.example.icon.MainActivity on device emulator-5554
[2013-12-09 15:34:29 - icon] ActivityManager: Starting: Intent {act = android.intent.action.MAIN cat = [android.intent.category.LAUNCHER] cmp = com.example.icon / .MainActivity }


Source as follows:
*****************************
MainActivity.java
*****************************
 
package com.example.icon;

import android.app.Activity;
import android.app.Fragment;
import android.app.TabActivity;
import android.os.Bundle;
import android.support.v4.app.FragmentActivity;
import android.widget.TabHost;
import android.widget.TabHost.TabSpec;


public class MainActivity extends FragmentActivity
{
@ Override
public void onCreate (Bundle savedInstanceState)
{

super.onCreate (savedInstanceState);
setContentView (R.layout.main);
/ / Get the Activity inside TabHost components
TabHost tabHost = getTabHost ();
/ / Create the first page
TabTabSpec tab1 = tabHost.newTabSpec ("tab01")
. SetIndicator ("Comedy") / / set the title
. SetContent (R.id.tab01); / / set the content
/ / Add the first tab
tabHost.addTab (tab1);
TabSpec tab2 = tabHost.newTabSpec ("tab02")
/ / Place the icon on the label
title. SetIndicator ("stay Moe", getResources ()
. GetDrawable (R.drawable.ic_launcher))
. SetContent (R.id.tab02);
/ / Add a second tab
tabHost.addTab (tab2);
TabSpec tab3 = tabHost.newTabSpec ("tab03")
. SetIndicator ("action figure")
. SetContent (R.id.tab03);
/ / Add a third tab
tabHost.addTab (tab3);



}

private TabHost getTabHost () {
/ / TODO Auto-generated method stub
return null;
}
}

**************************
Main.xml
**************************
  
xmlns: android = "http://schemas.android.com/apk/res/android"
android: id = "@ android: id / tabhost"
android: layout_width = "match_parent"
android: layout_height = "match_parent"
android: layout_weight = "1">
android: layout_width = "match_parent"
android: layout_height = "match_parent"
android: orientation = "vertical">
android: id = "@ android: id / tabs"
android: layout_width = "match_parent"
android: layout_height = "wrap_content" />
android: id = "@ android: id / tabcontent"
android: layout_width = "match_parent"
android: layout_height = "match_parent">
<-! Define the contents of the first tab ->
android: id = "@ + id/tab01"
android: orientation = "vertical"
android: layout_width = "fill_parent"
android: layout_height = "fill_parent">
android: layout_width = "wrap_content"
android: layout_height = "wrap_content"
android: text = "daughter of the King - 2012/12/12"
android: textSize = "11pt" />
android: layout_width = "wrap_content"
android: layout_height = "wrap_content"
android: text = "East Sea Dragon - 2012/12/18"
android: textSize = "11pt" />

<-! Define a second tab content ->
android: id = "@ + id/tab02"
android: orientation = "vertical"
android: layout_width = "fill_parent"
android: layout_height = "fill_parent">
android: layout_width = "wrap_content"
android: layout_height = "wrap_content"
android: text = "Skeleton Demon - 2012/08/12"
android: textSize = "11pt" />
android: layout_width = "wrap_content"
android: layout_height = "wrap_content"
android: text = "spider - 2012/09/20"
android: textSize = "11pt" />

<-! Define the contents of the third tab ->
android: id = "@ + id/tab03"
android: orientation = "vertical"
android: layout_width = "fill_parent"
android: layout_height = "fill_parent"
android: textSize = "11pt">
android: layout_width = "wrap_content"
android: layout_height = "wrap_content"
android: text = "Monkey King - 2012/09/19"
android: textSize = "11pt" />
android: layout_width = "wrap_content"
android: layout_height = "wrap_content"
android: text = "Pig - 2012/10/12"
android: textSize = "11pt" />





Reply:
You manifest affirmed saying no ah
Reply:
Saying how can I declare ah. . . . Neighborhoods

No comments:

Post a Comment