Note that there are some explanatory texts on larger screens.

plurals
  1. POSetContentView does not work
    text
    copied!<p>I search for an hour - I can't find a mistake:</p> <pre><code>public class favdetail extends Activity { @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.favdetail); setTitle("gespeicherter Artikel"); Intent intent = getIntent(); id = intent.getStringExtra("id"); TextView t1 = (TextView)findViewById(R.id.favtextView1); // Überschrift t1.setText("sss"); } } </code></pre> <p>I insert the activity in the manifest. This activity starts (button click in main activity) - but does not show the elements (from the layout xml / textviews)!</p> <p><strong>UPDATE:</strong> xml layout:</p> <pre><code>&lt;ScrollView xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="fill_parent" android:layout_height="fill_parent" android:background="#ffffff" android:visibility="gone" android:id="@+id/scrollmain" &gt; &lt;RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="wrap_content" &gt; &lt;TextView android:id="@+id/favtextView1" android:textColor="#000000" android:text="ddd" android:layout_width="wrap_content" android:layout_height="wrap_content" android:padding="7dp" android:textAppearance="?android:attr/textAppearanceMedium" /&gt; &lt;TextView android:id="@+id/favtext3" android:layout_width="fill_parent" android:layout_height="wrap_content" android:layout_below="@+id/favtextView1" android:padding="7dp" android:textAppearance="?android:attr/textAppearanceSmall"/&gt; &lt;View android:id="@+id/imgv" android:layout_width="fill_parent" android:layout_height="1dp" android:layout_below="@+id/favtext3" android:background="@android:color/darker_gray"/&gt; &lt;WebView android:id="@+id/webView1" android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_alignParentLeft="true" android:layout_alignParentRight="true" android:layout_below="@+id/imgv" &gt;&lt;requestFocus/&gt;&lt;/WebView&gt; &lt;/RelativeLayout&gt; &lt;/ScrollView&gt; </code></pre> <p>I've a second activity with a similar layout. There it works.</p> <p>My manifest.xml:</p> <pre><code>&lt;manifest xmlns:android="http://schemas.android.com/apk/res/android" package="&gt;&gt;package name removed&lt;&lt;" android:versionCode="1" android:versionName="1.0" &gt; &lt;uses-sdk android:minSdkVersion="8" android:targetSdkVersion="15" /&gt; &lt;uses-permission android:name="android.permission.INTERNET"/&gt; &lt;uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/&gt; &lt;uses-permission android:name="android.permission.ACCESS_WIFI_STATE"/&gt; &lt;application android:icon="@drawable/ic_launcher" android:label="@string/app_name" android:hardwareAccelerated="true" android:uiOptions="splitActionBarWhenNarrow" android:theme="@style/AppTheme2" &gt; &lt;activity android:name=".MainActivity" android:configChanges="orientation|keyboardHidden|screenSize" android:label="@string/title_activity_main" &gt; &lt;intent-filter&gt; &lt;action android:name="android.intent.action.MAIN" /&gt; &lt;category android:name="android.intent.category.LAUNCHER" /&gt; &lt;/intent-filter&gt; &lt;meta-data android:name="android.app.default_searchable" android:value=".Search" /&gt; &lt;/activity&gt; &lt;activity android:configChanges="orientation|keyboardHidden|screenSize" android:name=".Search" &gt; &lt;intent-filter&gt; &lt;action android:name="android.intent.action.SEARCH" /&gt; &lt;/intent-filter&gt; &lt;meta-data android:name="android.app.searchable" android:resource="@xml/searchable"/&gt; &lt;/activity&gt; &lt;activity android:configChanges="orientation|keyboardHidden|screenSize" android:name=".detail"&gt;&lt;/activity&gt; &lt;activity android:configChanges="orientation|keyboardHidden|screenSize" android:name=".settings"&gt;&lt;/activity&gt; &lt;activity android:configChanges="orientation|keyboardHidden|screenSize" android:name=".kategorie"&gt;&lt;/activity&gt; &lt;activity android:configChanges="orientation|keyboardHidden|screenSize" android:name=".tag"&gt;&lt;/activity&gt; &lt;activity android:configChanges="orientation|keyboardHidden|screenSize" android:name=".favoriten"&gt;&lt;/activity&gt; &lt;activity android:configChanges="orientation|keyboardHidden|screenSize" android:name=".favdetail"&gt;&lt;/activity&gt; &lt;/application&gt; &lt;/manifest&gt; </code></pre> <p>SOLVED!</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload