在Android N使用分屏时,我希望activity在用户点击通知时在当前活动窗口中启动,但如果通过单击通知启动,则Android N始终activity在第二个窗口中启动.
NotificationCompat.Builder mBuilder =
new NotificationCompat.Builder(this)
.setSmallIcon(R.drawable.notification)
.setAutoCancel(false)
.setContentTitle("Demo Title")
.setContentText("Demo");
Intent intent = new Intent(this, MainActivity.class);
intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP | Intent.FLAG_ACTIVITY_SINGLE_TOP);
intent.putExtra("myIntent", "test");
PendingIntent pendingIntent = PendingIntent.getActivity(this, 0, intent, PendingIntent.FLAG_UPDATE_CURRENT);
mBuilder.setContentIntent(pendingIntent);
NotificationManager mNotificationManager = (NotificationManager) getSystemService(Context.NOTIFICATION_SERVICE);
Notification notification = mBuilder.build();
notification.flags = Notification.FLAG_NO_CLEAR;
mNotificationManager.notify(156, notification);
Run Code Online (Sandbox Code Playgroud)
什么时候intent比发射activity.
Intent in = new Intent(MainActivity.this, SecondActivity.class);
startActivity(in);
Run Code Online (Sandbox Code Playgroud)
前 - 我在前台有两个应用程序,如第一个窗口中的Chrome浏览器和第二个窗口中的Facebook,现在我在Chrome浏览器中搜索某些内容,此时我收到了通知Gmail.现在当我点击Gmail通知而不是通过替换Facebook在第二个窗口中 …
android android-intent android-notifications split-screen android-7.0-nougat
我想为我的Android应用启用分屏.如果我试图拖动我的应用程序使其占据我的Android设备的上半部分,它会给出消息"应用程序不支持分屏".但是,对于其他应用程序,如Facebook和WhatsApp,我可以使用分屏.我正在使用LGE Nexus 5X和Android 7(牛轧糖),它支持分屏.
美好的一天,
我想禁用分屏,并获得"预期结果"屏幕截图中显示的结果.(Toast with text"App不支持分屏")
在"实际结果"屏幕中,您可以看到android:resizeableActivity="false"对应用程序的影响,但仍然启用了分屏.我该如何禁用它?
实际结果:
我喜欢vim和NerdTree,但我厌倦了这样一个事实,即每当我试图打开一个文件进行查看时,有一半时间它会删除我正在编辑的旧文件并打开它,另一半则分裂面板分成两半让我看两页.
拆分屏幕有时会很有用,但我无法弄清楚为什么NERDTree有时会这样做.我只是转到树中的文件并点击进入.不知道发生了什么,但有点烦人.
我有两个Android应用程序在平板电脑上以多窗口模式运行;App1和App2。App1是焦点,我将广播从App1发送到App2。在那里,我使用startActivity从外部打开了一个网址。但是该Web URL在App1中而不是App2中打开,因为App1成为焦点。虽然我从App2启动了网址。
我想在App2中打开网址。因此,我可能首先需要将App2从我的代码中移开?怎么做?
有没有办法只在足够大的屏幕上为活动配置多窗口支持,例如平板电脑?
https://developer.android.com/preview/features/multi-window.html#configuring没有提到这一点.设置android:minimalHeight和android:minimalWidth似乎没有帮助,因为
如果用户以分屏模式移动分隔线以使活动小于指定的最小值,系统会将活动裁剪为用户请求的大小.
使用案例:对于某些活动,在非常小(分割)的屏幕尺寸中运行可能没有意义.在这些情况下,活动不应支持多窗口模式.
我一直在用 React Native 创建电子商务应用程序。我对分屏支持有一些疑问。
如果视图具有滚动视图,则应用程序屏幕工作正常,但没有滚动视图的屏幕将无法工作。
我对以下内容有疑问
提前致谢。
我正在尝试在我的应用中支持分屏功能.
目标SDK目前是27
defaultConfig {
applicationId "com.myvestige.vestigedeal"
minSdkVersion 19
targetSdkVersion 27
versionCode 46
versionName "5.5"
multiDexEnabled true
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
Run Code Online (Sandbox Code Playgroud)
并在应用程序标记的清单中将resizeableActivity添加到"true".
<application
android:name=".activity.MyApplication"
android:allowBackup="false"
android:icon="@drawable/newicon1"
android:label="@string/app_name"
android:largeHeap="true"
android:supportsRtl="true"
android:theme="@style/AppTheme"
tools:replace="android:icon"
android:resizeableActivity="true">
Run Code Online (Sandbox Code Playgroud)
当我用三根手指向下滑动(手动屏幕分割)时,此应用程序不支持 " 分屏或画中画 ".
还附上我正在收到的错误消息的屏幕截图.我使用vivo-v9(8.1.0)进行测试,支持分屏.
请帮助我找到我做错的事.
谢谢
我在分屏模式下运行我的两个应用程序。第一个应用程序 A,第二个应用程序 B。现在,当我从应用程序 A 启动 Google 地图等外部活动时,它总是在应用程序 B 的第二个屏幕上打开它。我希望它在应用程序 A 的第一个屏幕上打开。我即使尝试过FLAG_ACTIVITY_LAUNCH_ADJACENT,也无济于事。
val intent = Intent(Intent.ACTION_VIEW,
Uri.parse("http://maps.google.com/maps?daddr=$latitude,$longitude"))
intent.addFlags(Intent.FLAG_ACTIVITY_LAUNCH_ADJACENT)
activity.startActivityForResult(intent, MAP_NAVIG_RC)
Run Code Online (Sandbox Code Playgroud)
简而言之,Android 总是在分屏的第二屏中打开外部活动。如何在第一个屏幕中启动它?
我有 2 个视频,我想在分屏中并排播放。它们具有相同的持续时间和维度。我找到了几年前开发的代码来完成这项工作。问题是,它充满了错误,可能是因为我使用的是较新的 Matlab 版本(2014a)。错误从 (%name of the new avi file) 开始。
任何人都可以尝试修复它:
% select two files:
[filename1,pathname1] = uigetfile('.avi','pick first AVI file');
[filename2,pathname2] = uigetfile('.avi','pick second AVI file');
file1 = fullfile(pathname1,filename1);
file2 = fullfile(pathname2,filename2);
pdMovie1 = aviread(file1);
pdMovie2 = aviread(file2);
fileinfo1 = aviinfo(file1);
fileinfo2 = aviinfo(file2);
% check if AVI files have the same length and height:
if fileinfo1.NumFrames~=fileinfo2.NumFrames || ...
fileinfo1.Height~=fileinfo2.Height
errordlg('files are not compatible!')
else
% inspired by Herbert Ramoser in Message-ID:
% <art0c0$l9fip$1@ID-148798.news.dfncis.de>
for i=1:size(pdMovie1,2)
output(i).cdata …Run Code Online (Sandbox Code Playgroud) split-screen ×11
android ×9
multi-window ×6
avi ×1
matlab ×1
matlab-cvst ×1
nerdtree ×1
react-native ×1
video ×1
vim ×1