Folge dem Video um zu sehen, wie unsere Website als Web-App auf dem Startbildschirm installiert werden kann.
Anmerkung: Diese Funktion erfordert derzeit den Zugriff auf die Seite über den integrierten Safari-Browser.
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout android:id="@+id/LinearLayout01"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
xmlns:android="http://schemas.android.com/apk/res/android">
<ScrollView android:id="@+id/ScrollView01"
android:scrollbars="horizontal|vertical"
android:alwaysDrawnWithCache="false"
android:layout_height="match_parent"
android:layout_width="match_parent">
<HorizontalScrollView android:id="@+id/HorizontalScrollView01"
android:layout_height="fill_parent" android:layout_width="wrap_content">
<LinearLayout android:id="@+id/LinearLayout02"
android:layout_width="wrap_content"
android:orientation="horizontal"
android:layout_height="fill_parent">
<ImageButton android:src="@drawable/1"
android:id="@+id/b_1"
android:layout_width="wrap_content"
android:layout_marginLeft="2dip"
android:layout_marginRight="2dip"
android:layout_height="fill_parent"
android:padding="5dip"
android:background="@drawable/1"
android:clickable="true">
</ImageButton>
<ImageButton
android:src="@drawable/2"
android:id="@+id/b_2"
android:layout_height="fill_parent"
android:layout_width="fill_parent"
android:layout_marginLeft="2dip"
android:layout_marginRight="2dip"
android:padding="5dip"
android:background="@drawable/2">
</ImageButton>
<!-- Weitere ImageButtons -->
</LinearLayout>
</HorizontalScrollView>
</ScrollView>
</LinearLayout>
package firstApp.Activity;
import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.ImageButton;
import android.widget.Toast;
public class StartActivity extends Activity {
private ImageButton b_1;
private ImageButton b_2;
private ImageButton b_3;
private ImageButton b_4;
private ImageButton b_5;
View.OnClickListener actionListener = new View.OnClickListener() {
public void onClick(View v) {
if (v == b_1) {
startActivity(new Intent(StartActivity.this, Activity1.class));
}
else if (v == b_2) {
startActivity(new Intent(StartActivity.this, Activity2.class));
}
else if (v == b_3) {
startActivity(new Intent(StartActivity.this, Activity3.class));
}
else if (v == b_4) {
startActivity(new Intent(StartActivity.this, Activity4.class));
}
else {
Toast.makeText(getBaseContext(), "Keine Action vorhanden",
Toast.LENGTH_SHORT).show();
}
}
};
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
b_1 = (ImageButton) findViewById(R.id.b_1);
b_1.setOnClickListener(actionListener);
b_2 = (ImageButton) findViewById(R.id.b_2);
b_2.setOnClickListener(actionListener);
b_3 = (ImageButton) findViewById(R.id.b_2);
b_3.setOnClickListener(actionListener);
b_4 = (ImageButton) findViewById(R.id.b_2);
b_4.setOnClickListener(actionListener);
}
}