该ñ开发者预览版的文件列举了自由多窗口模式选项:
大型设备的制造商可以选择启用自由形式模式,用户可以在其中自由调整每个活动的大小.如果制造商启用此功能,除了分屏模式外,设备还提供自由形式模式.
文档还建议您应该在自由形式的多窗口模式下测试您的应用程序.
但是,我在Nxus 6和Nexus 9上加载N Developer Preview图像的两个设备使用分屏方法来支持多窗口.
有没有办法让自由形式模式继续下去?
另一个装置?(例如,像素C)
设置>开发人员选项?(我没有看到任何明显的事情,但我可能已经错过了它)
特定的模拟器配置?
一些adb命令?
一个魔法咒语,通过向后说一个命令来施放?
我猜我们可能会在5月下旬看到一些本机支持自由格式模式的硬件,但我只是看看是否有一个选项可以尝试一下.
无法在模拟器中启动AVD.输出:sh:1:glxinfo:not found无法启动'.../sdk/tools/qemu/linux-x86/qem u-system-i386':没有这样的文件或目录
使用Genymotion 2.8.0,我安装了具有API级别24的Google Nexus 6P 7.0.0设备.启动设备后,我已经刷新了ARM虚拟转换器并重新启动了设备.然后,我从http://opengapps.org/?download=true&arch=arm64&api=7.0&variant=pico下载了open_gapps,用于Playstore和其他应用程序的安装.通过将open_gapps zip文件拖放到设备中,它将被复制到SDcard下载文件夹而不是安装谷歌应用程序.
请有人建议我哪里出错了.提前致谢.
我想询问如何在Android Nougat上运行的Galaxy S7上更改我的应用程序的应用程序图标(参见附件截图)以填充整个图标空间.有没有办法做到这一点?
编辑:我认为这是因为这些应用程序有方形图标,我的是循环.有没有办法让它成为Galaxy S7 Nougat设备和所有其他设备的正方形?

我OneSignal SDK用来显示通知.我做到了OneSignalPushService.java.
OneSignalPushService.java:
public class OneSignalPushService extends NotificationExtenderService {
@Override
protected boolean onNotificationProcessing(OSNotificationReceivedResult notification) {
if (!TinyDbWrap.getInstance().isPushEnabled()) {
KLog.d(this.getClass().getSimpleName(), "Notification will not displayed");
return true;
}
OverrideSettings overrideSettings = new OverrideSettings();
overrideSettings.extender = new NotificationCompat.Extender() {
@Override
public NotificationCompat.Builder extend(NotificationCompat.Builder notificationBuilder) {
notificationBuilder.setDefaults(0);
notificationBuilder.setContentTitle(getApplicationContext().getResources().getString(R.string.app_name));
boolean is_in_silent_mode = false; /*or true by user's settings in app*/
/*TinyDbWrap.getInstance()... - it stores user's settings*/
KLog.d(OneSignalPushService.class.getSimpleName(), "Notification isSoundPushEnabled: " + TinyDbWrap.getInstance().isSoundPushEnabled());
if (!is_in_silent_mode && TinyDbWrap.getInstance().isSoundPushEnabled()) {
notificationBuilder.setSound(RingtoneManager.getDefaultUri(RingtoneManager.TYPE_NOTIFICATION));
} else { …Run Code Online (Sandbox Code Playgroud) java android android-notifications onesignal android-7.0-nougat
更新:在带有Android Oreo(8.X)的模拟器上工作。我有可能直接对android源进行更改,因此,如果有人知道我必须更改或更新以使其正常工作的android源中的内容,这也将有所帮助(因此,我实际上并不需要Android 7解决方法(尽管无法进行Android 8更新)。
我在FrameLayout中有一个SurfaceView。SurfaceView通常会显示视频,例如,我实际上是在绘制图像。问题是,如果我将FrameLayout(或SurfaceView)的尺寸设置为宽度大于10.000像素,则会在左侧裁剪。
在Android 7.1.1上进行了测试(在设备和仿真器上:Android TV(1080p)API 25
public class TestActivity extends Activity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
//add surfaceview
TestSurfaceView testSurfaceView = new TestSurfaceView(this);
setContentView(testSurfaceView);
//resize
FrameLayout.LayoutParams bgParams = (FrameLayout.LayoutParams) testSurfaceView.getLayoutParams();
//testcase full hd - working
bgParams.width = 1920;
//testcase 2 - working - each segment is 330px as 9900 / 1920 * 64 (default segment width) == 330
//bgParams.width = 9900;
//testcase 3 - working
//bgParams.width = 10000;
//testcase 4 - not working - …Run Code Online (Sandbox Code Playgroud) android surfaceview android-source android-x86 android-7.0-nougat
我有这个代码.
PopupWindow popUp = new PopupWindow();
popUp.setFocusable(true);
popUp.setOutsideTouchable(true);
popUp.setWidth(ViewGroup.LayoutParams.MATCH_PARENT);
popUp.setHeight(600);
popUp.setContentView(anchorView);
popUp.showAsDropDown(anchorView);
popUp.update();
Run Code Online (Sandbox Code Playgroud)
它完美适用于Android版<Android Nougat.但是在Android Nougat中,弹出窗口显示在屏幕顶部而不是相对于锚点视图.
我想让我的应用程序自动安装apk.这适用于api <24.但对于24岁,它失败了.Android实现了额外的安全性:
对于定位到Android 7.0的应用,Android框架会强制执行StrictMode API策略,该策略禁止在应用外部公开file:// URI.如果包含文件URI的intent离开了您的应用程序,则该应用程序将失败并出现FileUriExposedException异常.
所以我尝试了这个:
Uri myuri;
if (Build.VERSION.SDK_INT < Build.VERSION_CODES.N){
myuri = Uri.parse("file://"+outapk);
} else {
File o = new File(outapk);
myuri = FileProvider.getUriForFile(con, con.getApplicationContext().getPackageName() + ".provider", o);
}
Intent promptInstall = new Intent(Intent.ACTION_VIEW).setDataAndType(myuri,"application/vnd.android.package-archive");
con.startActivity(promptInstall);
Run Code Online (Sandbox Code Playgroud)
但得到一个致命的例外:
com.android.packageinstaller "Caused by: java.lang.SecurityException: Permission Denial: opening provider android.support.v4.content.FileProvider from ProcessRecord{b42ee8a 6826:com.android.packageinstaller/u0a15} (pid=6826, uid=10015) that is not exported from uid 10066".
Run Code Online (Sandbox Code Playgroud)
我的清单中有export = true.
问题似乎是packageinstaller无法使用content:// uri.
有没有办法允许应用程序以编程方式安装带有api24的apk?
uri securityexception apk packageinstaller android-7.0-nougat
看来android的My Files应用程序与以下AndroidManifest.xml配置不兼容:
<intent-filter>
<data android:scheme="file" />
<data android:pathPattern=".*\\.myext" />
...
Run Code Online (Sandbox Code Playgroud)
一些在线资源推荐使用
<intent-filter>
<data android:scheme="content" />
<data android:mimeType="application/octet-stream" />
...
Run Code Online (Sandbox Code Playgroud)
这意味着您的应用将尝试打开所有二进制文件.哪个不理想,但很好,只要它有效......
好吧,当您安装最新的Android更新并更新到时,惊喜它会停止工作7.0 Nougat.
为了解决这个问题,我尝试使用:
<intent-filter>
<data android:scheme="content" />
<data android:mimeType="*/*" />
...
Run Code Online (Sandbox Code Playgroud)
并看到mime类型为空.所以似乎Nougat版本不仅扰乱了原始的URL,并隐藏了它的扩展名,但它也失去了mime类型?!
有谁见过自定义文件扩展名(文件扩展名关联)的任何工作示例Android 7.0 Nougat?如何配置android清单XML?我应该使用哪个targetSdkVersion?
我正在尝试创建一个Android应用程序,在设备屏幕关闭时实时连续记录设备位置数据.我的代码可以在Android 6.0及更早版本中正常运行,但似乎Android 7.0+破坏了我的应用.
我已经实现了一个使用唤醒锁的Android前台服务,并订阅了Google FusedLocation API.关闭屏幕后,onLocationChanged永远不会触发回调.
有谁见过这个问题的解决方案?我尝试通过Android应用的Android设备设置以及Google服务框架和融合位置禁用电池优化.
public class ForegroundLocationService extends Service implements
GoogleApiClient.ConnectionCallbacks,
GoogleApiClient.OnConnectionFailedListener,
LocationListener {
private static final String TAG = ForegroundLocationService.class.getSimpleName();
// the notification id for the foreground notification
public static final int GPS_NOTIFICATION = 1;
// the interval in seconds that gps updates are requested
private static final int UPDATE_INTERVAL_IN_SECONDS = 15;
// is this service currently running in the foreground?
private boolean isForeground = false;
// the google api client
private GoogleApiClient googleApiClient; …Run Code Online (Sandbox Code Playgroud) android ×8
android-x86 ×1
apk ×1
galaxy ×1
genymotion ×1
gps ×1
intentfilter ×1
java ×1
location ×1
onesignal ×1
popupwindow ×1
surfaceview ×1
uri ×1
wakelock ×1