[q]How to get the present layout of an activity - Java for Android App Development

I have used a command in an onclicklistener of button to change the layout without creating a new activity like this
setContentView(R.layout.myxml);
Now to i want to override onBackPressed so that
if layout is a changed one,it will first go to default layout ,then exit the app.
But how can i identify that which layout is currently set on the activity
Sent from my GT-S5570 using XDA Premium 4 mobile app

you could store the layouts id in a class variable and inflate the new layout via a fragment (like within the navigation drawer by google) so on the buttons onclick the layout is inflated via a fragment and within onBackPressed you could inflate the former fragment, by setting it's id!
Sent from my Nexus 5 using XDA Premium 4 mobile app

thenobol said:
you could store the layouts id in a class variable and inflate the new layout via a fragment (like within the navigation drawer by google) so on the buttons onclick the layout is inflated via a fragment and within onBackPressed you could inflate the former fragment, by setting it's id!
Sent from my Nexus 5 using XDA Premium 4 mobile app
Click to expand...
Click to collapse
Thanks.i got the sol already
Sent from my GT-S5570 using XDA Premium 4 mobile app

Related

Possible to change app icons and text below icons?

On a stock vibrant?
Get Launcher Pro from the marketplace
And desktop visualiser
Sent from my Galaxy S using the XDA App
dxtop pro, long press icon for options. you may need to grab an icon pack. gl
what about getting the entire name of the apps to show up instead of fading off. There's plenty of room if a second line is used.
Xianku said:
Get Launcher Pro from the marketplace
Click to expand...
Click to collapse
That only allows changes to dock icons...what about application icons?
Sent from my SGH-T959 using XDA App
rogerchew said:
That only allows changes to dock icons...what about application icons?
Sent from my SGH-T959 using XDA App
Click to expand...
Click to collapse
You can change app icons on with Any cut or Better cut.
rogerchew said:
That only allows changes to dock icons...what about application icons?
Sent from my SGH-T959 using XDA App
Click to expand...
Click to collapse
If you have Launcher Pro (Plus):
-Long press on the homescreen
-go to shortcuts
-applications
-tap the app you want
-a screen should come up with the stock icon and title for the app
-tap on the icon and change it to whatever you want (it will go to your gallery, so you'll need to have already downloaded the icon you want)

Setting one icon in the center?

My phone really only consists of 3 screens and I only use one icon for everything, which I have on my main home screen. Is there any way to place that icon in the center?
Since our phones only have space for four icons across, its kinda hard to place that in the center. I'm using launcherProPlus
Sent from my ADR6300 using XDA App
Pretty sure you can change the amount of columns and rows using launcher pro. You can also resize icons using lpp as well
Sent from my ADR6300 using XDA App
Tried to use launcherpro, but no such luck
Sent from my ADR6300 using XDA App
launcherpro 5x5
install with long press NOT add button (lets you choose icon)
should work
if not, do a 5x5, use a clear icon and either just "know' its there, or choose wallpaper that has an "icon like" look in the middle - trial and error to line up "invisible" icon to wallpaper
hint - use non scrolling wallpaper option
hope that helps
ps - i'm pretty new to this so there may be a better way - but this way does work

How do i do it?

I would like to be able to swipe a certain spot on my screen and switch to expanded desktop is there a way for me to setup a shortcut like that?
I have searched the web and i cant find any free simple ways of doing this so some help would be great.
I am using cyanogenmod
Sent from my Nexus 4 using xda app-developers app
There's no simple way to do that unfortunately. Might be a good option to have available from the Nav Ring (quick launch targets) now that you mention it however. As far as how to code that, not a clue.
The most efficient, currently availalbe, way I've found is to have an expanded desktop quick settings tile. I can open the quick settings panel with a gesture from a launcher screen and select it from there.
Can't you do this with the app gesture control?
Ok ignore that. Just checked and you can only hide status bar. Not enter expanded desktop mode
Sent from my Nexus 4 using xda app-developers app
Alex240188 said:
Can't you do this with the app gesture control?
Ok ignore that. Just checked and you can only hide status bar. Not enter expanded desktop mode
Sent from my Nexus 4 using xda app-developers app
Click to expand...
Click to collapse
Yep you said it, i have tried gmd and gmd doesn't allow me to make a shortcut to CM's expanded desktop.
Sent from my Nexus 4 using xda app-developers app

Open one app from another?

Are there any apps that will let me open up 1 app when it looks like another? For example if I put the messaging app on my home screen can I press it and make it actually open the email app instead?
Sent from my SAMSUNG-SGH-I337 using xda app-developers app
redstar299 said:
Are there any apps that will let me open up 1 app when it looks like another? For example if I put the messaging app on my home screen can I press it and make it actually open the email app instead?
Sent from my SAMSUNG-SGH-I337 using xda app-developers app
Click to expand...
Click to collapse
Nova launcher....can change app icons. Not sure what you really are trying to do though.
Sent from my GT-I9505 using Tapatalk 2
Well the problem is when you move the apps to the sd card..if you reboot they drop out of any folders you have on the homescreen. So I was trying to have a system app, change the icon and name and have it open an sd card app so it remains on a reboot. Was just a theory I wanted to see if it works as a workaround for the apps dropping out after a reboot
Sent from my SAMSUNG-SGH-I337 using xda app-developers app
redstar299 said:
Well the problem is when you move the apps to the sd card..if you reboot they drop out of any folders you have on the homescreen. So I was trying to have a system app, change the icon and name and have it open an sd card app so it remains on a reboot. Was just a theory I wanted to see if it works as a workaround for the apps dropping out after a reboot
Sent from my SAMSUNG-SGH-I337 using xda app-developers app
Click to expand...
Click to collapse
Pretty sure it would be impossible. The icons are like shortcuts in windows. A pretty little graphic that calls a command (in this case am) to open the app. The reason it drops is the OS is attempting to be smart and since it can't find the app on boot (sdcard has to be mounted first) is drops the shortcut.
Only suggestion is try a widget that lets you make shortcuts.
Edit
Or try a shortcut app like
https://play.google.com/store/apps/details?id=com.sika524.android.quickshortcut
Or
https://play.google.com/store/apps/details?id=teq.QCustomShortcut
Sent from my GT-I9505 using Tapatalk 2
I found a semi decent workaround ..in Nova Launcher there's a swipe action feature when you can set an app to open a different app when you swipe it vs pressing it. So I took a non sd app, changed the icon to the icon of the app I wanted to open and changed the name to the app I wanted to open..then added a "-s" after it so I know it's a swipe action app. Not bad..
Sent from my SAMSUNG-SGH-I337 using xda app-developers app

Access Verizon hidden menu on our G4

Download launcherpro from playstore, add laucherpro activity widget, scroll down to home and select the one listed as hidden menu activity. Score!
Sent from my VS986 using XDA Free mobile app
So what does this get you?
In trouble if you don't remember what you change. It gives you acess to change settings such as turn on and off features of your phone.
Sent from my VS986 using XDA Free mobile app
Would love some screen shots of what is available to change and if it would be worth the time?
Here you go, not sure what a lot of these do but I'm sure someone here does.
Sent from my VS986 using XDA Free mobile app
This should be how you guys can turn on themes. This is the Lg Home hidden menu
Do you need pro version of launcher pro. Cause I don't see any activity widgets
Nope, it should be the 1×1 activity widget.
Sent from my VS986 using XDA Free mobile app
this menu has been in previous LG devices but is not the "main" hidden menu. you guys can't find any other hidden menu?
and you can use this app to find hidden activities without changing your launcher: https://play.google.com/store/apps/details?id=de.szalkowski.activitylauncher&hl=en
just open app.. select "all activities" from the top drop down menu and poke around.
It works without changing your launcher. The widget is available in stock launcher. You can also access service menu with this app and yours.
Sent from my VS986 using XDA Free mobile app
I'm unable to find the menus on the activity launcher. It seems it's not as complete as launcher pro.
Sent from my VS986 using XDA Free mobile app
mikec86 said:
Download launcherpro from playstore, add laucherpro activity widget, scroll down to home and select the one listed as hidden menu activity. Score!
Sent from my VS986 using XDA Free mobile app
Click to expand...
Click to collapse
I did this, but what did you launch to get to this menu?
It's under home and then home hidden menu activity I believe. After you create the shortcut you can uninstall the launcher pro app. The shortcut will remain.
Sent from my VS986 using XDA Free mobile app
Did anyone else get this working? I followed OP and do not see hidden settings under home screen using activity launcher. See my screen shot above.
Nova launcher wont allow me to enter those. Says app not installed or something :/. I got in to the other secret menu but not the main one. Sadly the main hidden menu has bt stuff that I might be interrested. Any idea why this happens. Mine is european 815.
autoprime said:
this menu has been in previous LG devices but is not the "main" hidden menu. you guys can't find any other hidden menu?
Click to expand...
Click to collapse
One of the options on this hidden menu is "Support_Secret_Menu". I wonder if that'll activate an additional menu.
It'd be nice to have Display Frame Rate option on this menu.
crash
When i try to add the activity widget it crashes on me. Not sure if its because i have 7 screens or a active wallpaper or what..
phillymade said:
Did anyone else get this working? I followed OP and do not see hidden settings under home screen using activity launcher. See my screen shot above.
Click to expand...
Click to collapse
Click on home and it will open up a sub menu.
Sent from my VS986 using XDA Free mobile app
I have given up. I have the same LaunherPro installed, and have selected the same activity widget, but I do not have a hidden menu option in my list. Tried to uninstall and reinstall and no go. Thanks though, good find.
Idk. I installed the Hidden Activities app and found Verizon Hidden Menu but it won't open and instead I get an error message.
Sent from my Nexus 6 using Tapatalk

Categories

Resources