I have a very simple MainActivity, and from this Activity I launch another Activity (with a dialog so that it floats on top of MainActivity.
The problem is that there is always a delay before the second action appears. I would say that it takes almost 1 second to display it, and there is generally no code in the second activity. The only code in the second Office is the following:
package MyPackage;
import android.app.Activity;
import android.os.Bundle;
import android.widget.ArrayAdapter;
import android.widget.ListView;
import android.widget.TextView;
public class JobViewActivity extends Activity {
@Override
protected void onCreate(android.os.Bundle savedInstanceState)
{
super.onCreate(savedInstanceState);
setContentView(R.layout.jobview);
}
@Override
protected void onResume() {
super.onResume();
}
}
MainActivity has a ListView with nodes, and there is a list of listeners connected to the ListView in onCreate, like this:
public void onCreate(Bundle savedInstanceState)
{
requestWindowFeature(Window.FEATURE_NO_TITLE);
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
_nodeRowAdapter = new NodeRowAdapter(this, _nodes);
listView = (ListView)findViewById(R.id.ListViewNodes);
listView.setAdapter(_nodeRowAdapter);
listView.setOnItemClickListener(new OnItemClickListener() {
public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
Intent i = new Intent(getApplicationContext(), JobViewActivity.class);
startActivity(i);
}
});
But when the ListItem function is pressed and the Click listener is launched, it takes about 1 second to display the pop-up window.
In the popup, the layout is not very advanced. Here is the layout:
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent" android:weightSum="1"
android:stretchColumns="1" android:orientation="vertical">
<TableLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:stretchColumns="1" android:layout_height="wrap_content" android:id="@+id/tableLayout1">
<TableRow>
<TextView
android:text="Id: "
android:padding="10dip"/>
<TextView
android:text="Ext id: "
android:gravity="right"
android:padding="10dip" />
</TableRow>
</TableLayout>
<RelativeLayout android:layout_width="fill_parent" android:layout_height="wrap_content" android:layout_alignParentBottom="true" android:id="@+id/relativeLayout1">
<LinearLayout android:id="@+id/linearLayout1" android:layout_width="fill_parent" android:layout_height="wrap_content" android:background="#E7F3F1">
<Button android:text="Start" android:id="@+id/button1" style="@style/ButtonText" android:layout_weight="1" android:background="@drawable/button_green"></Button>
<Button android:text="Bom" android:id="@+id/button2" style="@style/ButtonText" android:layout_weight="1" android:background="@drawable/button_red"></Button>
<Button android:text="Mer" android:id="@+id/button3" style="@style/ButtonText" android:layout_weight="1" android:background="@drawable/button_yellow"></Button>
<Button android:text="Nav" android:id="@+id/button4" style="@style/ButtonText" android:layout_weight="1"></Button>
</LinearLayout>
</RelativeLayout>
<RelativeLayout android:layout_height="fill_parent" android:layout_width="fill_parent" android:layout_below="@+id/tableLayout1" android:layout_alignParentLeft="true" android:layout_above="@+id/relativeLayout1" android:padding="6dip">
<TextView style="@style/JobViewHeader" android:id="@+id/textView1" android:text="Something: "></TextView>
<TextView style="@style/JobViewHeader" android:id="@+id/TextView2" android:text="Something: " android:layout_below="@+id/textView1"></TextView>
<TextView style="@style/JobViewHeader" android:id="@+id/TextView3" android:layout_marginTop="16dp" android:text="Kund: " android:layout_below="@+id/TextView2"></TextView>
<TextView style="@style/JobViewHeader" android:id="@+id/TextView4" android:text="Something: " android:layout_below="@+id/TextView3"></TextView>
<TextView style="@style/JobViewHeader" android:id="@+id/TextView5" android:text="Something: " android:layout_below="@+id/TextView4"></TextView>
<TextView style="@style/JobViewHeader" android:id="@+id/TextView6" android:text="Something: " android:layout_below="@+id/TextView5"></TextView>
<TextView style="@style/JobViewHeader" android:id="@+id/TextView7" android:text="Something: " android:layout_below="@+id/TextView6"></TextView>
<TextView style="@style/JobViewHeader" android:id="@+id/TextView8" android:layout_marginTop="20dp" android:text="Something: " android:layout_below="@+id/TextView7"></TextView>
<TextView android:layout_height="wrap_content" android:text="TextView" android:layout_width="wrap_content" android:layout_alignBaseline="@+id/textView1" android:layout_alignBottom="@+id/textView1" android:layout_toRightOf="@+id/textView1" android:id="@+id/textViewPickuptime"></TextView>
<TextView android:layout_height="wrap_content" android:text="TextView" android:layout_width="wrap_content" android:layout_alignBaseline="@+id/TextView2" android:layout_alignBottom="@+id/TextView2" android:layout_toRightOf="@+id/TextView2" android:id="@+id/textViewPickupAddress"></TextView>
<TextView android:layout_height="wrap_content" android:text="TextView" android:layout_width="wrap_content" android:layout_above="@+id/TextView4" android:layout_toRightOf="@+id/TextView3" android:id="@+id/textViewCustomer"></TextView>
<TextView android:layout_height="wrap_content" android:text="TextView" android:layout_width="wrap_content" android:layout_alignBaseline="@+id/TextView4" android:layout_alignBottom="@+id/TextView4" android:layout_toRightOf="@+id/TextView4" android:id="@+id/textViewNbrOfPassengers"></TextView>
<TextView android:layout_height="wrap_content" android:text="TextView" android:layout_width="wrap_content" android:layout_above="@+id/TextView6" android:layout_toRightOf="@+id/TextView5" android:id="@+id/textViewRoutine"></TextView>
<TextView android:layout_height="wrap_content" android:text="TextView" android:layout_width="wrap_content" android:layout_alignBaseline="@+id/TextView6" android:layout_alignBottom="@+id/TextView6" android:layout_toRightOf="@+id/TextView6" android:id="@+id/textViewServiceFee"></TextView>
<TextView android:layout_height="wrap_content" android:text="TextView" android:layout_width="wrap_content" android:layout_alignBaseline="@+id/TextView7" android:layout_alignBottom="@+id/TextView7" android:layout_toRightOf="@+id/TextView7" android:id="@+id/textViewHelp"></TextView>
<TextView android:layout_height="wrap_content" android:text="TextView" android:layout_width="wrap_content" android:layout_below="@+id/TextView8" android:layout_alignLeft="@+id/TextView8" android:id="@+id/textViewExtra"></TextView>
</RelativeLayout>
</RelativeLayout>
, , .
Im Samsung Galaxy S2.