2011-04-19 5 views
0

나는 안드로이드에서 이메일 애플 리케이션의 새로운 모듈에 노력하고 있습니다.이메일 애플 리케이션 in 안드로이드

내 main.xml에 파일 :

<?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" 
       android:text="" /> 
      <TextView 
       android:id="@+id/textview2" 
       android:layout_width="fill_parent" 
       android:layout_height="fill_parent" 
       android:text="" /> 
      <TextView 
       android:id="@+id/textview3" 
       android:layout_width="fill_parent" 
       android:layout_height="fill_parent" 
       android:text="" /> 
       <TextView 
       android:id="@+id/textview4" 
       android:layout_width="fill_parent" 
       android:layout_height="fill_parent" 
       android:text="" /> 
       <TextView 
       android:id="@+id/textview5" 
       android:layout_width="fill_parent" 
       android:layout_height="fill_parent" 
       android:text="" /> 
     </FrameLayout> 
    </LinearLayout> 
</TabHost> 

그 작업을 잘. 내 검색어 : 5 개의 탭 (메일 작성,받은 편지함, 보낸 편지함, 임시 보관함 및 연락처)이 있습니다. 해당 탭을 클릭하면 해당 응용 프로그램을 표시해야합니다. 예 : 원 메일 탭 작성을 클릭하고 메일 응용 프로그램을 작성해야 표시됩니다.받은 편지함 탭을 클릭하면받은 편지함 메일을 표시해야합니다.

일부 문제는이 문제에 도움이 될 수 있습니까?

Pls는 완전한 사서함 응용 프로그램 소스 코드 링크를 참조합니다.

감사합니다.

+2

을 코드를 메일 클라이언트 용으로 사용하려면 검색 엔진을 사용하거나 코더를 사용하도록 제안하십시오. 이 유형의 요청은 주제와 관련이 없습니다. – Mat

답변

0

Hello, TabWidget Android 개발자 사이트에서 자습서를 통해 탭과 관련된 작업에 대해 설명합니다.

당신은 각 탭에 대한 활동을해야합니다, 당신이 (당신의 TabActivity에서)과 같이 그들 사이를 전환하여 탭 호스트 설정합니다 : 당신이 완전한 소스를 찾고 있다면

public void onCreate(Bundle savedInstanceState) { 
    super.onCreate(savedInstanceState); 
    setContentView(R.layout.main); 

    Resources res = getResources(); // Resource object to get Drawables 
    TabHost tabHost = getTabHost(); // The activity TabHost 
    TabHost.TabSpec spec; // Resusable TabSpec for each tab 
    Intent intent; // Reusable Intent for each tab 

    // Create an Intent to launch an Activity for the tab (to be reused) 
    intent = new Intent().setClass(this, InboxActivity.class); 

    // Initialize a TabSpec for each tab and add it to the TabHost 
    spec = tabHost.newTabSpec("inbox").setIndicator("Inbox", 
        res.getDrawable(R.drawable.ic_tab_inbox)) 
       .setContent(intent); 
    tabHost.addTab(spec); 

    ... 
+0

David에게 감사드립니다. 나는 너에게 고맙다. –

+0

어느 누구도 안드로이드에서받은 편지함과 보낸 편지함에 대한 코드를 제안 할 수 있습니까? 나는 정말로 많이 봤다. Pls 날 도와 줘요 !! –

관련 문제