230 questions
- Bountied 0
- Unanswered
- Frequent
- Score
- Trending
- Week
- Month
- Unanswered (my tags)
0
votes
1
answer
1k
views
Is there a way to slow down the speed of the screen on purpose in Android?
I have an issue that TextView's content vibrates up and down in a moment.
it looks like turns WRAP_CONTENT into MATCH_PARENT, but i'm not sure.
so i want to see it slowly how to change the Texview's ...
3
votes
1
answer
87
views
How to get the middle of the screen for API>=19
The button should move to the middle of the screen when clicked. But every time I get different position of button in different devices. And I don't know how can I fix it.
This code what I use:
...
0
votes
1
answer
196
views
The bundle i sent to Fragment from Activity is still alive when i rotate the screen. WHY?
I have an Activity and there are a TextView, an EditText, a button and, a FrameLayout.
I put some words in the EditText and I push the send button, the Activity's TextView is gonna be changed with the ...
0
votes
0
answers
111
views
Android Screen density qualifiers
I understand how android picks density bucket.This answer explains how android picks density buckets.
My question is why does android uses buckets instead of using the linear relation?
For example ...
0
votes
1
answer
517
views
TypedValue.applyDimension producing wrong dimensions
I use TypedValue.applyDimension and displayMetrix.scaledDensity to set text size in the TextView on my Xiaomi Redmi 5 plus and get surprizing results: text in the TextView is much larger than the one (...
1
vote
1
answer
2k
views
How to lock android screen during screen mirroring?
I am developing an android application for mirroring android screen to car display. I used MediaProjection for getting screen; using that api I was able to mirror screen and now I want to lock android ...
0
votes
1
answer
49
views
Shouldn't the right be left + width for a view?
For a custom view that draws a rectangle I see the following code in the onDraw
@Override
protected void onDraw(Canvas canvas) {
int left = getPaddingLeft();
int right = ...
4
votes
0
answers
395
views
Android screen recorder with internal audio
I'm trying to record the android mobile screen using Mediaprojection and Media Recorder. I'm able to record the screen along with audio using mic.
Below is my code.
private void initRecorder() {
...
1
vote
0
answers
122
views
Use overridePendingTransition with multiple screens
I'm trying to use overridePendingTransition in my app but I'm using multiples screens in the same xml (I'm programming a android game) and when I switch from one screen to another I use the Visibility ...
1
vote
1
answer
4k
views
Declare Layout_Params.flag_secure in menifest
Android application screen can be prevent from taking screenshot via this code
@Override
protected void onCreate(@Nullable Bundle savedInstanceState) {
getWindow().setFlags(WindowManager....
0
votes
1
answer
2k
views
How to position the view with margin that will look same for all devices?
I'm trying to position a view in the center to make it look good by adding 130 (margin-top) programmatically, however, I'm not sure how to give other android devices such as tablets to look the same? ...
1
vote
2
answers
1k
views
Splash Screen Android - Count Down Timer Display
I am trying to use splash screen for my app.
I want to display Count down timer in my splash screen.
So far I am able to achieve the splash screen working but don't know how to display count down ...
2
votes
0
answers
30
views
android phone facing direction after rotation with sensor info
I've got log files of android phones to analyze and I'm trying to find the facing direction of the phone. The log has 4 columns: log_entry, time, key, value. I removed some irrelevant entries, keeping ...
1
vote
1
answer
1k
views
Why camera2 supported preview size width always bigger than height?
I'm working on a project which using camera2 API. When I get the list of supported output preview size using:
StreamConfigurationMap map = characteristics.get(CameraCharacteristics....
2
votes
0
answers
68
views
How to check screen on or off event of android only user behavior
I want to show some screen on the lock screen when the screen is turned on. So I wrote the following code.
public class BroadcastReceiverScreen extends BroadcastReceiver {
@Override
public void ...