Problem:
I am working with custom UI, now. There are some threads inside a program. Sometimes system shows message that my app has stopped. But it's false in my case. My app instantly restores itself and keeps working so everything is just fine.
Question:
Is there a way to disable any system messages appearing?
I am new in android and will be really grateful for some advice.
(edit)
Well so i found the following. App crushes on start after it was "closed" by hardware "<-- Back" button. Not every time only sometimes. When i select it in menu of opened apps once more it opens normally and runs just fine. Is there a way to remove that "crush" message? sure i do understand that app has crushed and its not good at all.
Related
all day I already despair of a waking up system for my VoIP app. I must have already read over 100 articles and documentation about it, however I have not found a solution that works for me.
Use case:
My app is running in the background. That means the home button was pressed
after my app was started and the device is in the home screen. As soon as a notification arrives, the app is supposed to open again on a certain route because a call is coming in.
In the lock screen I managed this pretty easily with flutter_local_notifications and within the app it was of course no problem either.
Note:
Only Android is important, the rest can be neglected
Android version 10+
Flutter version 2+
I appreciate any input on how to solve my problem and have a good week.
Kind regards,
Shiro
My app uses a pagerTabStrip with fragments. When the app goes to background and other memory intensive tasks run in foreground, the app will be killed. Then, if I recall the app, the fragments buttons onclick methods dont fire anymore. (side note: the color of the buttons is then wrong too, but the "visual click" down->up is working)
It is working fine when I manually kill the app or when it's just short term via onPause/onResume in background. It seems that in this system-kill-case sort of image of the app is taken and reloaded (incorrect).
If there is no direct way to fix this, I would like to catch this event, to just recreate the whole fragment, but I can't. I tried onTrimMemory and investigated the call order of onStop/onDestroy/onRestart ... but I couldnt figure out, when this "special kill" happens.
Thank you!
Got it.
First, to reproduce the issue, just launch the app, send to background and then hit the red circle-cross at the left pane of the logcat output frame in android studio as described here:
https://medium.com/inloopx/android-process-kill-and-the-big-implications-for-your-app-1ecbed4921cb
My workaround is to save the processID in onSaveInstanceState and to check if this changed in onCreate as described here:
https://stackoverflow.com/a/47483856/6053524
If so, the app has been killed by system and my issues of not proper working UI occured. To fix this I load the initial Activity via new Intent/startActivity to get a clean new application.
I've been having reports from users saying that they can no longer open our app; and I have now seen this on my own phone.
When I tap the app icon the screen goes black (showing the title but that's it), then quickly the black screen disappears and you're back in the OS.
Logcat shows zero issues when this happens.
Anyone know what could be happening? This issue has only become apparent within the last few weeks before that there were no reports from users on this particular issue.
EDIT: I've tried restarting the phone, force-stopping the app and clearing the cache+data to no avail.
If your app having use internet or http request over network then write code in method onResume otherwise for http request use asynchronous task
I was just bored of iOS and I recently changed to Android. I have a Nexus 5 device, and I've just finished installing my favourite apps in my device.
One of those apps is Line, the famous communication app from naver. I installed it and I configured it with a passcode in order to secure access to it, so no one despite me could see the "confidential" conversations inside.
The problem is even if I have the passcode enabled on line, if someone presses the "Recent list applications" button, they can see perfectly a screenshot of Line with my last conversation, so anyone could see what I was doing in Line.
I made the same test on iPhone and .. surprise ... iOS is taking the snapshot AFTER the passcode screen is enabled, so anyone could see nothing. It seems that in Android the snapshot is taken BEFORE passcode screen is enabled so anyone could see what last line screen looks like :)
So, having read other threads on this forums, I'm supposed to have several ways to solve this:
Wait for LINE's company NAVER to add an option to prevent this app to show on recent app list (adding android:excludeFromRecents="true" on THEIR manifest) [that won't be soon]
Wait for LINE's company NAVER to force the snapshot after passcode screen is enabled [maybe soon but not in company'sroadmap]
Decompile apk and change manifest on my own - or use FLAG_SECURE - (I tried it but when I launch the new app it suddenly dies on startup with a message "Application stopped". I thing LINE's server verifies on startup that the client app is what is expected to be, comparing sizes or something else)
So I don't know more ways to get around this. Do you have any more idea? I'm stucked on it.
Thank you a lot.
Detect when LINE has left foreground
Create a background service that detects if LINE is on foreground and when it leaves the foreground. (https://stackoverflow.com/a/14044662/1683141)
When line has left foreground, you should take action:
A. Stop the line app completely
OR
B. Open & "close" the line app so it will show a locked state in the multitask thumbnail
A possible way to accomplish situation B:
Optionally: detect which app the user has now opened and remember it
Wait a few seconds and open the LINE app again after the user closed it (by intent for example)
Now the LINE app will show the lock screen
Now let the background service open the home screen (or make an intent to the remembered activity)
Now the LINE app is back to the background and it will have a multitask-thumbnail showing the locked screen.
Ofcourse, this will create a loop, and this isn't a stable solution
-Option A is a relatively reliable, and a (in my opinion) good way to accomplish what you want: no one can see your secure chat. Disadvantage is that the application is now removed from multitasking.
-Option B is only an idea, but maybe, if it's done the right way, It could work.
Edit: Option A will not work. The application will not be removed from multitasking if the task is killed.
I'm working on an Android application, and I want it to get started right after the phone boots up. I used BroadcastReceiver, and the intent filter boot up complete, and the permission, and I think it's working; I turn on the phone, it boots up, and then it shows the main menu, and after 30 seconds or so, my app starts. Is that the normal behaviour for it? I would like it to start right away, without even showing the main menu first. Is that possible? or is this the best i can get? I didn't find anything about this issue in google, and I'm relatively new to Android so I'm not sure if that's the normal behaviour or not. Hope you can help me, thanks.
It sounds like what you are looking for is a Service. It will run in the background and can be set to auto start. I'm not sure that it necessarily come up faster than your activity does, but I think it will. Check these documents: http://developer.android.com/guide/components/services.html