开发者

how can i have a list of icons in my android app;

开发者 https://www.devze.com 2023-01-24 22:31 出处:网络
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 ap

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
}
0

精彩评论

暂无评论...
验证码 换一张
取 消