Beiträge von Evolutio

    Hey danke,
    es stürzt zwar nicht mehr ab, aber es wird auch nichts Angezeigt.
    Kann man nicht, sobald man in Tab1 ist ne andere Activity starten und dann durch die Activity das Layout News setzten?


    Z.B.
    mit der hier: ListActivity.java
    [JAVA]
    package com.evolutio.blocklaunch;


    import java.util.ArrayList;
    import java.util.Arrays;

    import android.app.Activity;
    import android.os.Bundle;
    import android.widget.ArrayAdapter;
    import android.widget.ListView;


    public class ListActivity extends Activity {

    private ListView mainListView ;
    private ArrayAdapter<String> listAdapter ;

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

    // Find the ListView resource.
    mainListView = (ListView) findViewById( R.id.mainListView );
    // Create and populate a List of planet names.
    String[] planets = new String[] { "Mercury", "Venus", "Earth", "Mars",
    "Jupiter", "Saturn", "Uranus", "Neptune"};
    ArrayList<String> planetList = new ArrayList<String>();
    planetList.addAll( Arrays.asList(planets) );

    // Create ArrayAdapter using the planet list.
    listAdapter = new ArrayAdapter<String>(this, R.layout.item, planetList);

    // Add more planets. If you passed a String[] instead of a List<String>
    // into the ArrayAdapter constructor, you must not add more items.
    // Otherwise an exception will occur.
    listAdapter.add( "Ceres" );
    listAdapter.add( "Pluto" );
    listAdapter.add( "Haumea" );
    listAdapter.add( "Makemake" );
    listAdapter.add( "Eris" );

    // Set the ArrayAdapter as the ListView's adapter.
    mainListView.setAdapter( listAdapter );
    }
    }
    [/JAVA]

    Hey,
    Ich komme einfach nicht weiter mit meinem Problem


    MainActivity.java


    Activity_main.xml
    [XML]
    <android.support.v4.view.ViewPager xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    android:id="@+id/pager"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    tools:context=".MainActivity" >


    <!--
    This title strip will display the currently visible page title, as well as the page
    titles for adjacent pages.
    -->


    <android.support.v4.view.PagerTitleStrip
    android:id="@+id/pager_title_strip"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:layout_gravity="top"
    android:background="#33b5e5"
    android:paddingBottom="4dp"
    android:paddingTop="4dp"
    android:textColor="#fff" />


    </android.support.v4.view.ViewPager>
    [/XML]


    Item.xml
    [XML]
    <TextView xmlns:android="http://schemas.android.com/apk/res/android"
    android:id="@+id/rowTextView"
    android:layout_width="fill_parent"
    android:layout_height="wrap_content"
    android:padding="10dp"
    android:textSize="16sp" >
    </TextView>
    [/XML]


    News.xml
    [XML]
    <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:orientation="vertical"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent">


    <ListView android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    android:id="@+id/mainListView">
    </ListView>
    </LinearLayout>
    [/XML]


    Und der Error: