Note that there are some explanatory texts on larger screens.

plurals
  1. POAndroid - Get input (intent) from last activity to new activity but also have layout shown at the same time?
    primarykey
    data
    text
    <p>In the main activity of my app, it has the user enter their Name and click on a Shift number and click on submit. When they click on submit, it brings them to a new page (activity) and that page shows their Name and shift number again. But underneath, I want it to show the Timer (the timer that is provided in xml) but I don't know how to make it show the content of the layout and the input(intent) at the same time on one activity.</p> <p>Help? Is there a way to collaborate the two?</p> <p>This is my second activity's .java file:</p> <pre><code>package com.cyapps.downtimer; import android.app.Activity; import android.os.Bundle; import android.widget.TextView; public class WinderDTActivity extends Activity { @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); Bundle extras = getIntent().getExtras(); if (extras != null){ TextView textView = new TextView(this); String opName = extras.getString(MainActivity.OP_NAME); String rChoice = extras.getString(MainActivity.RADIO_CHOSEN); textView.setTextSize(15); textView.setText( "\n\tOperator Name: " + opName + "\n\t" + rChoice ); setContentView(textView); } } } </code></pre> <p>And this is the second activity's XML:</p> <pre><code>&lt;LinearLayout 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" android:gravity="center_horizontal" android:orientation="vertical" &gt; &lt;TimePicker android:id="@+id/timePicker1" android:layout_width="wrap_content" android:layout_height="wrap_content" /&gt; &lt;Button android:id="@+id/button1" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="@string/submit" /&gt; &lt;/LinearLayout&gt; </code></pre> <p>What I want is to have the second page/activity show the XML layout, and show the input that I got from the previous page as well. Is that possible?</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

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