диалоговое окно началось с предпочтительной активности со ссылками, доступными по клику

1

В моей PreferenceActivity я добавил кнопку "About", при нажатии вызывает следующую функцию:

public void InstructionsDialog(){
  AlertDialog.Builder ad = new AlertDialog.Builder(this);
  ad.setIcon(R.drawable.icon);
  ad.setTitle("About");
  ad.setView(LayoutInflater.from(this).inflate(R.layout.about_dialog,null));

  ad.setPositiveButton("OK", 
    new android.content.DialogInterface.OnClickListener() {
     public void onClick(DialogInterface dialog, int arg1) {
      // OK, go back to Main menu
     }
    }
   );

   ad.setOnCancelListener(new DialogInterface.OnCancelListener(){
     public void onCancel(DialogInterface dialog) {
      // OK, go back to Main menu   
     }
    }
   );

  ad.show();
 }

Макет выглядит следующим образом:      

<LinearLayout
    android:orientation="vertical"
    android:layout_width="fill_parent"
    android:layout_height="wrap_content"
    android:scrollbars="vertical" 
    android:scrollbarAlwaysDrawVerticalTrack="true"
    android:id="@+id/instructions_view" >

<TextView   android:id="@+id/TextView01" 
                android:layout_width="wrap_content" 
                android:layout_height="wrap_content" 
                android:paddingLeft="5px">
                </TextView>
<TextView   android:id="@+id/TextView02" 
                android:layout_width="wrap_content" 
                android:layout_height="wrap_content" 
                android:paddingLeft="5px"
                android:paddingTop="20px"
                android:text=
                "Thank you for downloading this application. Bug reports and request for additional features or languages are welcome.">
                </TextView>                
<TextView   android:id="@+id/TextView03" 
                android:layout_width="wrap_content" 
                android:layout_height="wrap_content" 
                android:paddingLeft="5px"
                android:paddingTop="20px"
                android:text=
                "This project makes use of the 'Android Wheel' created by Yuri Kankan and is licensed under the Apache License (http://www.apache.org/licenses/LICENSE-2.0.html)">
                </TextView>
<TextView   android:id="@+id/TextView04" 
                android:layout_width="wrap_content" 
                android:layout_height="wrap_content" 
                android:paddingLeft="5px"
                android:paddingTop="20px"
                android:layout_gravity="center"
                android:text="Copyright  2011, Tricky-Design" 
                ></TextView>

</LinearLayout>
</ScrollView>!

О экране

Это хорошо, но мне хотелось бы, чтобы ссылки в этом диалоге были гиперссылками. Я читал об использовании linkify, но это приводит к FC.

Я надеюсь, что кто-то может мне помочь.

Спасибо большое!

Теги:
hyperlink
preferenceactivity
dialog

1 ответ

3
Лучший ответ

Я сделал это, чтобы сделать это возможным:

Я создал пользовательский диалог, используя следующий пример: http://www.androidpeople.com/android-custom-dialog-example

В моих предпочтениях, которые я создал:

public void aboutScreen() {
    about about = new about(this);
    about.show();
}

Внутри этого настраиваемого диалога я могу делать все, что захочу, в том числе используя ссылку, чтобы сделать мои ссылки доступными.

Ещё вопросы

Сообщество Overcoder
Наверх
Меню