我想知道为什么弃用?它有用于不执行任务的用例:LayoutAlgorithm
.SINGLE_COLUMN
NARROW_COLUMNS
我有一个简短的HTML片段,其中包含比设备屏幕更宽的图像.NARROW_COLUMNS
没有调整图像大小以适应屏幕,而是SINGLE_COLUMN
缩小它以便用户无法水平滚动(这就是我想要的).
有关为何弃用的任何想法?
突然间,我开始收到相当多的崩溃报告,声称android.app.PendingIntent.getActivity方法不存在.
有人知道是什么原因引起的吗?
java.lang.NoSuchMethodError: android.app.PendingIntent.getActivity
at com.example.notification.NotificationHelper.showNotification(NotificationHelper.java:37)
at com.example.notification.NotificationHelper.showNotification(NotificationHelper.java:19)
at com.example.content.sync.userdata.TaskSynchronizer$2.onResultReceived(TaskSynchronizer.java:142)
at com.example.content.sync.BulkRequest.onResultReceived(BulkRequest.java:172)
at com.example.content.sync.SyncAdapterHelper.pushOrPull(SyncAdapterHelper.java:201)
at com.example.content.sync.SyncAdapterHelper.syncAll(SyncAdapterHelper.java:60)
at com.example.content.sync.SyncAdapter.onPerformSync(SyncAdapter.java:139)
at android.content.AbstractThreadedSyncAdapter$SyncThread.run(AbstractThreadedSyncAdapter.java:247)
Run Code Online (Sandbox Code Playgroud)
以下是我的NotificationHelper
课程:
public class NotificationHelper {
public static void showNotification( Context context, String title, String content, MenuItem itemToStart ) {
showNotification(context, title, content, itemToStart, null, itemToStart.id );
}
public static void showNotification( Context context, String title, String content, MenuItem itemToStart, Bundle extras ) {
showNotification(context, title, content, itemToStart, extras, itemToStart.id );
}
public static void showNotification( Context context, String …
Run Code Online (Sandbox Code Playgroud)