how can i have a list of icons in my android app;
can any one suggest how can i have a list of icons like browser icon,email icon and contacts icon upon clicking on those it should lead t开发者_StackOverflow社区o android browser,email and contacts apps respectively...right now i have done it, upon clicking buttons. Now i want icons(with image and text) instead of buttons.
I think you just need to use something like this:
<LinearLayout android:orientation="vertical">
<ImageView android:src="@drawable/icon" android:onClick="launchApp" />
<TextView android:text="@string/icon_name" android:onClick="launchApp" />
</LinearLayout>
and in your code you should have the corresponding method:
public void launchApp(View view) {
// do something
}
精彩评论