相关疑难解决方法(0)

在android中是否有任何方法可以获得设备虚拟键盘的高度

Android中是否有任何方法可以在运行时获取Android设备的虚拟键盘的高度.其实我想在键盘上方显示文本框.

sdk android

37
推荐指数
7
解决办法
7万
查看次数

Android N:如何在分屏时单击通知时在当前活动窗口而不是第二个窗口中启动活动?

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

19
推荐指数
1
解决办法
2107
查看次数

如何在Android中发送指针事件

我正试图在Android中检测虚拟键盘高度.

我发现了类似的话题:在Android中获取虚拟键盘的高度

似乎作者找到了一种检测高度的方法:

我找到了一种方法来获得它.在我请求打开虚拟键盘后,我发送了我生成的指针事件.它们的y坐标从设备高度开始减小.

我不明白该怎么做.

events android android-softkeyboard

7
推荐指数
1
解决办法
2265
查看次数

如何知道软键盘的高度

可能重复:
获取Android中虚拟键盘的高度

如果我点击EditText我会得到软键盘.我需要知道height默认的软键盘.我没有找到任何标准方法来获得软键盘的高度.如何知道heightAndroid上的软键盘?

android android-softkeyboard

5
推荐指数
0
解决办法
641
查看次数

如何获得Android键盘的高度?

如何获得Android键盘的高度?

我尝试:

KeyboardView keyboardView = new KeyboardView(_activity.getApplicationContext(), null);
Log.i("","xxx height " + keyboardCustom.mKeyboardView.getHeight());
            Log.i("","xxx height " + keyboardCustom.mKeyboardView.getBottom());
Run Code Online (Sandbox Code Playgroud)

但总是得到0.

keyboard android

3
推荐指数
1
解决办法
1万
查看次数