I am building an android application in phone gap. But when i change the orientation from portrait to landscape, i am getting the application from the beginning and not from where i was in the portrait view. how can i solve this issue ?
Were you using the tutorial?? If so, I apologize for the error. Android WebView by default re-loads the configuration when you change the orientation, and we do specify it in the manifest file:
<activity android:name=".YourAppName"
android:label="#string/app_name" android:configChanges="orientation|keyboardHidden">
The change above will not be required, because PhoneGap already has that. Unfortunately, the tutorial doesn't tell you to copy over the entire Android Manifest over and just specifies the permissions. In my opinion, this setting is critical to to having a working application that doesn't reset the state every time the WebView resizes itself.
This is how to fix this problem in android, when orientation changes, activity gets restarted, OnCreate() method gets called. To avoid this specify this in the manifest file for the Activity
Override the following method in Activity class.
public void onConfigurationChanged(Configuration newConfig) {
super.onConfigurationChanged(newConfig);
}
Related
I applied this notification without knowing what it does. Now UI is missing. It says "Some issues were found while trying to render this preview" while preview and when I run app, It shows a blank surface. How and Where can I configure this?
Finally I find what the notification changes in the project.
when I apllied notificitaion , it adds build.gradle:app to this twice like below.
implementation 'androidx.core:core-ktx:+'
implementation 'androidx.core:core-ktx:+'
Although I have already implemented this
'androidx.core:core-ktx:1.9.0'
This leads rendering problem.
I am testing a mobile app I have built and noticed that when I manually clear a ToastBar message through the touch interface, if there is a Component beneath it, such as a Button, it is clicked as well.
I know that in Android native development, it is possible to mark a Component in a way that does not allow this to happen. Does anyone know if there is such a method or "attribute" in Codename One too?
Iam developing an Android app using Android Studio, I referred this link to use different images resources but i failed to get the output.
What i need is "I have 480x640_240dpi, 480x800_240dpi, 480x854_240dpi, 600x1024_240dpi in my drawable-hdpi folder", but while running the app the images are stretching.
How to detect the correct resolution image to the corresponding device.
And also help me how to add images to the tablet (that too only in landscape mode, in my app tablet wont work on portrait as requirements).
Thanks in Advance.
Targeting specific resolutions is possible with resource directory qualifiers. For example you can create folder drawable-w320dp-h533dp-hdpi for 480px x 800px image on hdpi screen.
EDIT: Since you probably are using Android Studio, you can define the qualifiers in the dialog when you are creating new resource directory.
Put your all images according to the resolutions.
i.e
res/drawable-mdpi/graphic.png // bitmap for medium-density
res/drawable-hdpi/graphic.png // bitmap for high-density
res/drawable-xhdpi/graphic.png // bitmap for
extra-high-density res/drawable-xxhdpi/graphic.png // bitmap
for extra-extra-high-density
for more detail
http://developer.android.com/guide/practices/screens_support.html
After i had successfully ported the app. the app is running fine and taking touches on native ios nibs files where used for dialogs. But it is not taking touches on menu items.
let me explain this. It has some different view of axis. like tap on somewhere on screen will open some other menu which was not tapped. it seems it is taking touches but opening the desired menus but the location of buttons are not proper..
I had similar. In my case I had implementation of touchesBegan,touchesMoved and touchesEnd in View class with calling super. On iOS it works fine and messages going directly to controller. With apportable SDK it does not work. Maybe you have the same situation.
I was faced with the one problem.
AuidoStream doesn't works in Background mode.
So I added the "Required background modes" in Info.plist and selected "App plays audio".
But AuidioStream doesn't works in background mode yet.
In original, I had a sample AudioStream code.
I changed the some UI. origin audiostreamer works in background mode after i did like above.
But the audiostreamer that i changed some UI doesn't works in background mode.
I can't guess why this happens.
Please let me know if you know about this.
Thanks
Regards!
i had the same problem it was solved by using Required background modes in Info.plist and App plays audio. make sure you have not stopped the stream explicitly on viewDidUnload or viewWillDisappear kind of methods