我创建了一个由其他应用程序通过AIDL绑定的服务,并将其添加到清单中,如下所示:
<service android:name=".MyService">
<intent-filter>
<action android:name="org.example.android.myservicedemo.IService" />
</intent-filter>
</service>
Run Code Online (Sandbox Code Playgroud)
其中IService是AIDL接口.
通过这种方式,Eclipse向我显示警告导出的服务不需要权限.如果我删除intent-filter,警告消失,但显然应用程序无法绑定到服务.
这个警告意味着什么?
我最近创建了一个项目并添加了一个启动和主要活动.我编辑了清单文件,并将启动活动和主要活动添加到其中.添加主活动后,它会向我发出警告"导出的活动不需要权限".这给了我什么警告?我的API版本是android:15.
请帮帮忙,谢谢!
这是我的清单文件!
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.sliit.droidman"
android:versionCode="1"
android:versionName="1.0">
<uses-sdk android:minSdkVersion="10" android:targetSdkVersion="15" />
<application android:label="@string/app_name"
android:icon="@drawable/ic_launcher"
android:theme="@style/AppTheme">
<activity
android:name=".SplashActivity"
android:label="@string/app_name"
android:theme="@android:style/Theme.NoTitleBar">
<intent-filter>
<action android:name="android.intent.action.MAIN"/>
<category android:name="android.intent.category.LAUNCHER"/>
</intent-filter>
</activity>
<activity
android:name="com.sliit.droidman.main.MainActivity"
android:label="@string/app_name">
<intent-filter>
<action android:name="com.sliit.droidman.main.MAINACTIVITY" />
<category android:name="android.intent.category.DEFAULT"/>
</intent-filter>
</activity>
</application>
</manifest>
Run Code Online (Sandbox Code Playgroud) 我有一个AppWidgetProvider,我需要在小部件首次添加到主屏幕时进行一些初始化.我知道这样做的地方是onEnabled(Context context)方法.我的问题是永远不会调用此方法(据我在logcat中可以看到).
这是我的代码:
public class MyMonitorWidget extends AppWidgetProvider{
@Override
public void onEnabled(Context context) {
super.onEnabled(context);
Log.v("LOG", "Widget onEnabled");
Intent intentToFire = new Intent(UpdateAlarmReceiver.ACTION_UPDATE_ALARM);
context.sendBroadcast(intentToFire);
}
...
}
Run Code Online (Sandbox Code Playgroud)
和我的appwidget-provider xml:
<?xml version="1.0" encoding="utf-8"?>
<appwidget-provider
xmlns:android="http://schemas.android.com/apk/res/android"
android:initialLayout="@layout/widget_layout"
android:minWidth="146dp"
android:minHeight="74dp"
android:label="Monitor Widget"
/>
Run Code Online (Sandbox Code Playgroud)
并在清单中:
<receiver android:name="MyMonitorWidget" android:label="Monitor Widget">
<intent-filter>
<action android:name="android.appwidget.action.APPWIDGET_UPDATE" />
</intent-filter>
<intent-filter>
<action android:name="com.android.myMonitor.ACTION_NOTIFY_WIDGET"/>
</intent-filter>
<meta-data android:name="android.appwidget.provider"
android:resource="@xml/monitor_widget_info"/>
</receiver>
Run Code Online (Sandbox Code Playgroud)
您认为这个问题是什么?
android widget alarmmanager android-intent android-appwidget