Switching between the horizontal and vertical screens of android may also cause many problems.
1. Lock the screen direction and disable switching:Add the Activity parameter in AndroidManifest. xmlAndroid: screenOrientation = "landscape"ORAndroid: screenOrientation = "portrait" to keep the portrait Screen
2. the Activi
This article is an example of Android using Broadcastreceiver to realize the function of displaying the screen after the phone is powered on. Share to everyone for your reference, specific as follows:
In this example, how to use Broadcastrececiver is described. Use Broadcastreceiver to inherit this class, and override the public void Onreceiver (context context,intent Intent) method to add the functionalit
Android generates a long image for scrollView exceeding the screen size
Many times, we want to share all the content of an interface, but there is too much content, beyond the size of the screen, simple screenshots can no longer meet our needs, at this time, we can capture the Image Based on the height of the scrollVie
/** Obtain the window manager and default display, which we'll use to * find out the size of the Devi Ce ' s display (in pixels)*/WindowManager WindowManager=(WindowManager) Getsystemservice (Context.window_service); Display Display=Windowmanager.getdefaultdisplay (); /*Obtain the API level of the device running the game*/ intAPI =Android.os.Build.VERSION.SDK_INT; /** we ' re dealing with deprecated methods, so We filter older devices * (less than API.) to use the O Lder methods,
Android always monitors the Rotation Angle of the mobile phone. determines at which angle the vertical screen layout is loaded Based on the rotation angle.
I. Scenario Description:
During recent development, we encountered a problem that the operating system was aware of the horizontal and vertical screen layout when performing horizontal and vertical
Android supports screen recording and GIF conversion.
In my previous blog post, I learned several screen recording methods for mobile phones to better demonstrate the implementation of the APP, today, we will introduce two methods that are more comfortable for my personal use:
(1) After configuring the adb environment, run the cmd command to save the operation
Reprint Please specify: http://www.cnblogs.com/frank-zouxu/p/4158159.htmlToday, a company project in progress, encountered the problem of the screen to take the word, the problem is step, the first to solve how to intercept the device screen, because the Android device is based on the Linux kernel, so try to find the android
If you write an android desktop sliding switch Screen Control (1)
First, this control should inherit ViewGroup:
Initialization:
Public class MyGroup extends ViewGroup {private Scroller mScroller; private float mOriMotionX; private float handler; private VelocityTracker handler; private int mTouchState = running; private static final int TOUCH_STATE_REST = 0; private int mTouchSlop; private int mMaximumVelo
() method of the Intent Object , set the action, parameter:Android.intent.action.VIEW Call the Intent object's addcategory () Add type, parameter:Android.intent.category.DEFAULTCall the Intent object's setData (), set the data,Parameters:URI object, get uri object uri.parse ("Package:" +getpackagename ())Call startactivity ()Device_admin_sample.xmlDevice-adminxmlns:android= "Http://schemas.android.com/apk/res/android"> uses-policies> Limit-passwo
The following uses EditText as an example,
On a tablet, the keyboard is displayed in full screen by default. The following attributes disable full screen display.
Xml method:
Android: id = "@ + id/editText1"
Android: layout_width = "match_parent"
:
123
public boolean onTouch(View v, MotionEvent event) { returnmGestureDetector.onTouchEvent(event);}
See the source code of the Gesturedetector class ontouchevent to know, enter the function will enter the case motionevent.action_up this path, so call onfling function.This is what I want to say, because in my opinion gesturedetector may not be able to meet all the gesture needs, Ken can have one day, we need to throw away gesturedetector directly in the Ontouch
When the Image Library plays a slide, press the power key to disable the screen and then highlight the screen. The slides continue to play and no keyguard is displayed. How to display the unlock page after the screen is highlighted.
The modification method is to remove the FLAG_SHOW_WHEN_LOCKED flag. The modificatio
Android disables System sleep, keeps the screen hidden, and keeps the screen highlighted in the game.
There are two ways to implement this function. One is to declare in the manifest. xml file, and the other isCodeModify the flag of layoutparams. The details are as follows:
1. Use user-Permission declaration in the manifest. xml file. The Code is as follows:
From: http://hi.baidu.com/nignt_yoco/item/b6f173700c3df328d7a89cc3
The procedure is as follows:
1. Change the value of def_screen_off_timeout in the ults. xml file under the/frameworks/base/packages/settingsprovider/RES/values directory to-1, that is
1
"Def_screen_off_timeout">-1
The screen will never sleep. (But at last, I burned it onto the board. I didn't know whether it was because I set the display or something
In the MediaPlayer when playing video
Mmediaplayer.setscreenonwhileplaying (TRUE); has been set, there is no problem with native Android and there is no problem on the defy, one to Samsung's Galaxy has a problem, do not know where Samsung they changed. General words are set up to play the video screen without automatic. But there was a problem on Samsung. I had to look again. There are two ways to set up g
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.