小编Arn*_*old的帖子

如何安装较旧的SonarLint Eclipse插件

目前在Eclipse Marketplace中,SonarLint仅在最新版本(2.5.1)中提供.出于兼容性原因,我需要有版本(2.2.1).

如何安装我选择的旧版本?

eclipse sonarlint sonarlint-eclipse

9
推荐指数
3
解决办法
4013
查看次数

Android小部件的两个按钮以不同的意图调用相同的Activity

我在Android中有一个带有两个按钮的homescreenwidget.两个按钮都应该调用相同的活动(类),只需使用不同的intent和intent附加功能,以了解哪个按钮称为类.现在只有button1工作并调用活动.我还在被调用的Activity中收到keyvalue.

如何让第二个按钮工作?这是我的代码:

             public void onUpdate(Context context, AppWidgetManager appWidgetManager,
        int[] appWidgetIds) {

    super.onUpdate(context, appWidgetManager, appWidgetIds);

    for ( int i =0; i<appWidgetIds.length ; i++){

        int appWidgetId = appWidgetIds[i];

        Intent intent2 = new Intent(context, Main.class);
        Intent intent1 = new Intent(context, Main.class);

        // Intent put extras Button 1
        String bread1 = "secure";
        Bundle basket1 = new Bundle();
        basket1.putString("key", bread1);
        intent1.putExtras(basket1);

        // Intent put extras Button 2
        String bread2 = "insecure";
        Bundle basket2 = new Bundle();
        basket2.putString("key", bread2);
        intent2.putExtras(basket2);

        PendingIntent pending1 = PendingIntent.getActivity(context,0,intent1, 0);
        PendingIntent …
Run Code Online (Sandbox Code Playgroud)

android android-widget

6
推荐指数
1
解决办法
3426
查看次数