screen

How to fix rotation on webview for Android phones?

蓝咒 提交于 2019-12-19 10:28:26
问题 I'm trying to figure out how to fix the orientation problem on webview. Basically every time the user changes the orientation on the device the program goes white and reloads the entire page. This just takes to long. I'd like it to work like every other program that simply adjusts the page size to fit the orientation.I've tried reading other articles on the subject, but when I implement their solution it doesn't seem to fix the problem. Here is my current code. package testdev.HelloWebApp;

Android: How to find width and height of screen?

霸气de小男生 提交于 2019-12-19 09:12:32
问题 I am trying to find the width and height of the screen but none of the ways I have tried will work in the class I created, my code is below. Does anyone know how to find it? I cannot use the way I am trying below because .getWidth() is deprecated? public class Crate { public int acrossCrate; public int upDownCrate; Context theContext; WindowManager wm = (WindowManager)theContext.getSystemService(Context.WINDOW_SERVICE); Display display = wm.getDefaultDisplay(); int width = display.getWidth();

Android Development: Changing Screen Brightness in Service

我们两清 提交于 2019-12-19 09:04:05
问题 Now i do try again. I want to change the screen brightness. I've Tried: WindowManager.LayoutParams layoutParams = getWindow().getAttributes(); layoutParams.screenBrightness = 0.5F; // set 50% brightness getWindow().setAttributes(layoutParams); and seems to work in activity but when I am in service i get that getWindow() compile error. 回答1: A service cannot change the screen brightness that way. A service does not have a user interface, so it does not have Window . You can try to change the

Keeping screen on, which way?

心已入冬 提交于 2019-12-19 05:45:06
问题 I have found two ways on keeping the screen on: First one is simpler: getWindow().setFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON, WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON); Second one is using a wakelock and requiring an extra permission: PowerManager pm = (PowerManager) getSystemService(Context.POWER_SERVICE); wl = pm.newWakeLock(PowerManager.FULL_WAKE_LOCK, "DoNotDimScreen"); Is there any real difference between this two methods apart from the second one being more

Keeping screen on, which way?

こ雲淡風輕ζ 提交于 2019-12-19 05:44:06
问题 I have found two ways on keeping the screen on: First one is simpler: getWindow().setFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON, WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON); Second one is using a wakelock and requiring an extra permission: PowerManager pm = (PowerManager) getSystemService(Context.POWER_SERVICE); wl = pm.newWakeLock(PowerManager.FULL_WAKE_LOCK, "DoNotDimScreen"); Is there any real difference between this two methods apart from the second one being more

How can I stop Excel workbook flicker on automation open?

妖精的绣舞 提交于 2019-12-19 03:44:14
问题 I'm using GetObject with a workbook path to either create a new or grab an existing Excel instance. If it's grabbing an existing user-created instance, the application window is visible; if the workbook path in question is closed, it will open and hide, but not before it flickers on the screen. Application.ScreenUpdating does not help with this. I don't think I can use the Win32Api call LockWindowUpdate, because I don't know whether I'm getting or creating before the file is open. Is there

How can I integrate Tkinter with Python log in screen?

社会主义新天地 提交于 2019-12-18 16:39:34
问题 I am using Tkinter to create a login screen here. At the moment, the "keep me logged in" button at the bottom is redundant and will remain so. What I want to do is use this code: from tkinter import * root = Tk() label_1 = Label(root, text="Username") label_2 = Label(root, text="Password") entry_1 = Entry(root) entry_2 = Entry(root) label_1.grid(row=0, sticky=E) label_2.grid(row=1, sticky=E) entry_1.grid(row=0, column=1) entry_2.grid(row=1, column=1) checkbox = Checkbutton(root, text="Keep me

Make a Qt window autofit to the screen's size

三世轮回 提交于 2019-12-18 14:38:29
问题 I have a Qt application which needs to be loaded on mobile devices of different screen sizes. How do I make it autofit to the mobile device's screen size? 回答1: If you want your application's main window to occupy the whole screen as soon as it starts, use QWidget::showMaximized, e.g. int main(int argc, char **argv) { QApplication app(argc, argv); MyMainWidget widget; widget.showMaximized(); return app.exec(); } Note that showMaximized is a convenience function which internally calls the

Get Location From Center of Screen Swift MapKit

ぃ、小莉子 提交于 2019-12-18 13:34:52
问题 I'm new on Swift Programming, and I'm trying to build an app that I can get the coordinates of the center of the view with MapKit and Swift 2. I already can get the current location, but I need if I move on the map, the location set to the new point which will be the center of the screen. Can you help me with this please?. Regards, 回答1: You can use the regionDidChangeAnimated delegate method and call mapView.centerCoordinate. It will look like the following: func mapView(mapView: MKMapView,

Clear screen in C and C++ on UNIX-based system?

匆匆过客 提交于 2019-12-18 11:39:33
问题 I want to know: how to clean screen on an UNIX-based system? I searched on the Internet, but I've just found how to do it on Windows: system("CLS") I don't want exactly to clean cpmpletely the screen, but I want to open a "new page", such as in the NANO and VI editors. Thanks 回答1: Maybe you can make use of escape codes #include <stdio.h> #define clear() printf("\033[H\033[J") int main(void) { clear(); return 0; } But keep in mind that this method is not compatible with all terminals 回答2: You