目前在Eclipse Marketplace中,SonarLint仅在最新版本(2.5.1)中提供.出于兼容性原因,我需要有版本(2.2.1).
如何安装我选择的旧版本?
我在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)