In my PreferenceActivity I've added a button "About", when pressed the following function is called:
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();
}
The layout look like this:
<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>!
Which is good, but I would like that the links in this dialog are hyper links. I've read about using linkify but this results in FC.
I hope somebody can help me.
Thanks a lot!
What I've done to make this possible is the following:
I've made a custom dialog using the following example: http://www.androidpeople.com/android-custom-dialog-example
In my preferenceActivity I created:
public void aboutScreen() {
about about = new about(this);
about.show();
}
Inside this custom dialog I can do whatever i want, including using linkify to make my links click able.