How to restore default views in the debug tab? - android

I've made a mistake clicking pressing keys mouse... I don't know, but now my debug tab has a different behaivour from the default mode.
Is there a way to restore the default views of the Android Studio?

Related

How can I always show Android Studios Preview?

I have probably hit some setting in Android Studio. So my problem is, my Preview window hides every time I click somewhere in the xml code.
Obviously I want the preview available the entire time I'm in the xml editor so that I can view my changes, and also without having to click the Preview button all the time.
Any ideas?
Found the answer. The tabs in Android Studio seem to have different amount of actions attached to them, but you can access some more if you go to Window -> Active Tool Window (with the preview tab selected/focused) and then click "Docked Mode", an option previously unavailable in the tabs options. When Docked mode is activated for the tab it is now available in the tab options!
I need preview layouts when writing code.
click [android studio] > [preferences] > [layout editor]
uncheck [Hide preview window when editing non-layout files.]
It works for me.
A shortcut is also available for seeing preview in android studio
press ctrl + tab and a switcher window will open
you can select preview from there using arrows key
Click on View -> Tools Window - > Preview, on the left of preview have small setting icon, click on it and select Pinned Mode.
It works for me.

NavigationDrawer activity doesn't keep keyboard's state on orientation change

I created sample project using Android Studio: Create new Project -> Navigation Drawer Activity. In testing purposes, my content Fragmentcontains just a single EditText widget.
In my AndroidManifest I have this line for the main activity:
android:windowSoftInputMode="stateUnchanged|adjustResize"
Odd behavior: if I launch the app in portrait mode, open soft keyboard (by tapping on the EditText) and rotate device to landscape mode... keyboard disappears for some reason. If I create the same project but with no NavigationDrawer (just Activity + Fragment) the keyboard remains visible (as expected with stateUnchanged property).
Did anyone know what is the reason of such behavior? Actually I want to keep the keyboard expanded after switching to landscape mode (if it was opened in portrait). I can track keyboard state and via special flag restore its visibility when needed programmatically, I know. I just wonder why the native tools don't work with NavigationDrawer.

Tab-bar Settings as overlay in tablet?

I'm using Android action bar to show settings as follow in phone version.
when i click on settings it will call SettingsActivity, However in Tablet version i have to show Settings in a different format like below.
Here Settings icon should open as a drawer overlay(over any screen) with settings. How to achieve this? Is there any controls for showing these kind of overlay? The inside settings page contains other controls like spinner, switch etc.
I would use a Fragment, and then detect if the user is using a tablet or a smartphone. If it's a tablet, open a SlidingMenu with the Fragment inside, if it's a smartphone, open a FragmentActivity with the same Fragment inside. You could also customize the fragment to look slightly differently in the different cases using the layout folders.

Removing buttons from home screen

Can anyone point me on how to remove the existing buttons from the Android Launcher. I would like to remove the phone and explorer buttons and keep only the app drawer button. I went through the source code but couldn't notice three buttons being created. I was able to achieve the same with different home replacement app but it would be great if I could do it with default launcher app. Thanks.

Android Orientation issue, no scrolling

I am using Eclipse and developed an app that has 3 tabs using Android 1.5. The program works just fine.
1st problem--whenever the app is run, it change orientations, but does not show the scroll bars, thus allowing to scroll down(or up). Is this suppose to be happening? And how is it corrected?
2nd problem--if you are on say tab2, then open or close the key board (T-Mobile G1), the tab2 switches to tab1. No matter if you are one tab1 or tab2, opening/closing the keyboard will switch it back to tab1. Does anyone know what the fix is?
Investigate usage of ScrollView https://developer.android.com/reference/android/widget/ScrollView.html
I guess on keyboard open/close your activity is recreated (not sure though), try saving your tabs state (e.g. index of selected tab) https://developer.android.com/reference/android/app/Activity.html#onSaveInstanceState(android.os.Bundle) and restoring it during onCreate.

Categories

Resources