machen Ich bin neu in der Entwicklung ...Wie kann ich Web-Link in Alarmdialog
ich eine Aktionstaste zu Alert Dialog für meine Anwendung zu zeigen, hinzugefügt, die ich entwickeln werde .... ich nur geholt Eine XML-Datei für dieses Aktionsdialogfeld.
Ich habe diese XML als Alert Dialog Popup verwendet. unter Java-Code verwenden.
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="300dp"
android:layout_height="300dp"
android:weightSum="1">
<TextView
android:id="@+id/info"
android:layout_width="277dp"
android:layout_height="wrap_content"
android:text="Click the links below to contact us"
android:layout_marginTop="13dp"
android:layout_alignParentTop="true"
android:layout_centerHorizontal="true" />
<TextView
android:id="@+id/wa"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/wa"
android:textSize="30dp"
android:layout_marginTop="8dp"
android:layout_below="@+id/info"
android:layout_centerHorizontal="true" />
<TextView
android:id="@+id/fb"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/fb"
android:textSize="30dp"
android:layout_marginTop="8dp"
android:layout_below="@+id/wa"
android:layout_centerHorizontal="true" />
</RelativeLayout>
Java-Code:
public void info(MenuItem item) {
View v = LayoutInflater.from(MainActivity.this).inflate(R.layout.alertdiag, null);
TextView waf = (TextView) findViewById(R.id.wa);
TextView fbf = (TextView) findViewById(R.id.fb);
AlertDialog.Builder builder = new AlertDialog.Builder(MainActivity.this);
builder.setMessage("About");
builder.setView(v);
builder.setCancelable(false);
builder.setPositiveButton("Okay", new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
dialog.cancel();
}
});
builder.show();
Jetzt kann ich diese Textviews in meiner Haupttätigkeit als Alarm Dialog sehen. Aber ich kann nicht auf die Links klicken. Irgendeine Lösungsmöglichkeit????
Vielen Dank im Voraus .....
Ich habe dich. Ich habe erfolgreich benutzerdefinierte Layout in AlertDialog aufgebläht. aber der Hyperlink-Text ist nicht klickbar ..... – Jijoe
Wenn ich etwas mache, um Hyperlink in AlertDialog klicken und die App ausführen Es automatisch die gesamte App tötet, wenn ich auf die Schaltfläche Info auf der Aktionsleiste klicken. – Jijoe