screen

how to show dialogs in android taking screen orientation changes into account

懵懂的女人 提交于 2019-12-23 04:40:14
问题 this is driving me crazy. i have read the documentation for creating dialogs in Android and it seems to make sense, except when the screen orientation changes. I have Activity.onCreateDialog() where I create the dialog. I also have Activity.onPrepareDialog() where I prepare the dialog. Then in my Activity.onCreate() method, I call showDialog(id) that's all well and good and behaves properly. now comes the tricky part. I rotate the screen. it destroys the activity and creates a new one.

I want to make splash screen and now I have two problems?

懵懂的女人 提交于 2019-12-23 04:39:31
问题 1: I want to have a splash screen but I only have a window?so,how to do with sth like parm 2: I've used a while(!done) to draw the window so how to break out with a function or sth else here is my code and much thx to you g++ -o m_splash m_splash.cpp -lX11 -lImlib2 #include <stdio.h> #include <X11/Xlib.h> #include <Imlib2.h> #include <unistd.h> int main() { Imlib_Image m_img; Display *m_dpy; Pixmap m_pix; Window m_root; Screen *scn; int m_width, m_height; const char *filename = "/home/ang/so

screen.width and screen.height different values in different APIs/devices

China☆狼群 提交于 2019-12-23 02:19:52
问题 Edit: also happens with $('body').width() and window.outerWidth API 2.3.3 HVGA Before and after rotating device outputs same screen width (320) API 3.0 WXGA Width and height toggle each rotation for example starts with screenWidth:1280 screenheight: 800 I rotate 90 now has screenWidth:800 screenheight: 1280 so what do I do if I want to make certain changes on rotations according to dimensions and want to target all APIs? I need a value which is the same for all devices. Edit: For certain

Loading Screen from any Class in Swift

我只是一个虾纸丫 提交于 2019-12-23 02:19:04
问题 I am trying to implement a loading screen in swift, that I can reuse from any class in the project (I have a few classes that will handle 'long running' activities) The public function is, from another answer: public class LoadingOverlay{ var overlayView = UIView() var activityIndicator = UIActivityIndicatorView() class var shared: LoadingOverlay { struct Static { static let instance: LoadingOverlay = LoadingOverlay() } return Static.instance } public func showOverlay(view: UIView) {

How to start linux with gui without monitor? [closed]

前提是你 提交于 2019-12-23 02:03:06
问题 Closed. This question is off-topic. It is not currently accepting answers. Want to improve this question? Update the question so it's on-topic for Stack Overflow. Closed 7 years ago . I met a problem. I had a server which is installed redhat enterprise 5.5. And one Qt program was running on this server. So what I should do is to turn on my server, the server will start automaticly with Gui and that Qt program will start automaticly. I finished all on my desktop. But while I start this server

Turning screen on and off programmatically not working on some devices

好久不见. 提交于 2019-12-23 01:45:16
问题 I use the code below to turn the screen on and off. Both pieces of code work on most devices (tested on Galaxy Note, Galaxy S2, etc. etc.) but don't work on a few (mostly tablets but some phones as well). On some devices screen on works but screen off doesn't, and the opposite holds for some other devices. I'm not sure what the cause is since it's pretty standard code (and since it works on some devices that means triggering these functions i.e. the function call, is not a problem). Are there

Large layout affects Galaxy Note

旧巷老猫 提交于 2019-12-22 17:57:15
问题 I want my app to have a specific layout for Android tablets and another for mobiles. In order to do this, I have created two layout files in two folders, like this: layout/main.xml and layout-large/main.xml I want the small layout to be applied to Galaxy Note. However, the large layout is applied (which is normal, since its resolution qualifies it as large screen). Since this layout does not fit well to Galaxy Note's screen size, is there a way to apply the 'normal' layout to Galaxy Note? 回答1

How to support phones up to 4.0, excluding tablets?

丶灬走出姿态 提交于 2019-12-22 14:47:15
问题 There is an easy way to provide compatibility for phones up to 4.0, but excluding tablets? For example, can I: <uses-sdk android:minSdkVersion="4" android:targetSdkVersion="14" /> And then set: <supports-screens android:anyDensity="true" android:xlargeScreens="false" android:largeScreens="true" android:normalScreens="true" android:resizeable="true" android:smallScreens="true" /> This config filter the tablets from market? Many thanks for the help! 回答1: First of all, let me be very clear in

Refresh table control after action

匆匆过客 提交于 2019-12-22 10:53:56
问题 I have a screen with a table control in it (generated with the Screen Painter) that shows records from a database table. The screen also has a button, which shows a popup when it's clicked. The popup has a form to add a record to the database table. When the form is submitted the record is added to the database, but when the popup is closed, the screen that shows the database records isn't refreshed i.e. the new record isn't shown. Simply calling the screen again doesn't seem to work. How to

Android: programmatically get position of the widget on desktop relative to other widgets

会有一股神秘感。 提交于 2019-12-22 09:57:56
问题 On Android the user can place a widget on the desktop and then to move it by long touch and moving the finger while still holding. Is it possible to programmatically get the position on the screen where the widget was moved by long touch? I need my desktop widget to know if it's near the edge of the screen of the device. Depending on whether it's on the top of the desktop or at the bottom different layouts for the widget will be chosen. I would expect that this position is not given in pixels