Can I use tabs in more than 1 activity? - Java for Android App Development

I'm making an app that uses tabs in my main activity. I want to be able to open another activity which will also use tabs. Everything I've could think of to try results in my app crashing when I open the second activity.
Is this possible to do? If so can someone help me out?
Sent from my Moto X using XDA Free mobile app

jeb192004 said:
I'm making an app that uses tabs in my main activity. I want to be able to open another activity which will also use tabs. Everything I've could think of to try results in my app crashing when I open the second activity.
Is this possible to do? If so can someone help me out?
Sent from my Moto X using XDA Free mobile app
Click to expand...
Click to collapse
Log? Activity code? Layouts? Manifest file?
Usually the most common reason this happening is because people forget to add the new activity to the AndroidManifest.xml file, if you've already done that then we need more information than you've currently given.
Sent from my HTC One using Tapatalk

It is definitely possible, can you show us where it errors out (I.e. logcat)

Well. I just discovered viewpager and I was able to get that to work how I wanted to use the tabs. Kinda wish I would've found this before asking the question. I have the horizontal scrolling working to swipe between pages. Can you guys help me get the vertical scroll view to work so I can view the rest of the text on each page?
Edit: never mind. Just got the vertical scrolling to work.
Sent from my Moto X using XDA Free mobile app

Code:
<ScrollView >
<LinearLayout> <!--or whatever layout you choose-->
</LinearLayout>
</ScrollView>

Related

Shortcut/app to add widget...??

Hey,
Does any one know if there is an app that replicates the long press on the desktop to add a widget or whether this could be achieved with another app the likes of better cut...? I've have tried using better cut to create a new shortcut but don't know what to fill in the appropiate fields.
Any help would be greatful.
Thanks.
try bettercut @ market
Thanks for the response but as i put above have tried using bettercut but there is nothing as standard in there to for 'add to home' and come know the correct processes for the create your own.
Need it as trying to create sense style dock for 3rd party launchers. Have it all working apart from that....
Sent from my HTC Desire using XDA App

[Q] Application icons

Just started teaching myself to program Android apps. I have a book called "Android Apps for Absolute Beginners" by Wallace Jackson. Im in the process of making a hello world app and the instructions for making an icon for my app is a bit convoluted.
I have 3 icons, 72x72, 48x48, and 32x32. I have put them in /res/drawable-hdpi/icon.png, /drawable-mdpi/icon.png, /drawable-ldpi/icon.png, respectively.
The app runs in the emulator, but when i goto the app drawer it shows a default icon instead of mine.
Any help would be great. As a side note, is 72x72/hdpi what would be used for qHD and 1280x800 tablet screens?
Still cant figure this out, if anyone could help itd be great. Thanks
Your Manifest file must point to the name of your icon in the drawable folder, instead of the default icon. So do that where it says android:icon="@drawable/icon"
Sent from my Nexus S using XDA Premium App
Not sure how you are having problems here.... If you have not edited the manifest file it will look for the icon.png in whichever drawable folder the phone is using. Eg.. HTC Desire will read from drawable-hdpi.
This is a good resource for creating icons btw...
http://android-ui-utils.googlecode.com/hg/asset-studio/dist/index.html
One thing to note is that the emulator (and sometimes real devices) are bad at refreshing icons. Try and uninstall your app before running it again from Eclipse.
Tony
Thx guys. My manifest and folders were good, but I was using a 1.5 AVD. As soon as I changed it to 2.3 it worked. I'll have to test later to find out how to get it to work on older versions of Android
Sent from my PG86100 using XDA App

[IDEA] Extending DOT VIEW Notifications For Other Apps

We all know that HTC launched the Dot View Case along with the HTC One M8 which impressed a quiet a lot of us. But one of the drawbacks it had was the lack of support for apps other than the system apps.
Also recently Shen posted a tweet showing some progress in the right direction which definitely brought light to our hopes.
So I came across this idea which will help speed this up and could be ready in a few weeks.
My idea is to make use of an app called Dynamic Notifications which is available in the Play Store. For those who don't know, it like the Active Notification found on the Moto X.
So what we can do is replace the icons in the app with the ones similar to the Dot View icons. I have already ripped apart the Dot View App to get my hands on the font used which I have attached below. So using this font we can simple create icons like the one I have attached.
I know it would be inappropriate to modify someone else's work but we could take the permission of the developer and if possible the developer of the app could himself take this project up.
I already tried this but I am kind of novice in app modding and keep getting installation errors.
The icon which I make has white font with transparent background so you might not see the thumbnail but click on it to view it.
AshritShetty said:
We all know that HTC launched the Dot View Case along with the HTC One M8 which impressed a quiet a lot of us. But one of the drawbacks it had was the lack of support for apps other than the system apps.
Also recently Shen posted a tweet showing some progress in the right direction which definitely brought light to our hopes.
So I came across this idea which will help speed this up and could be ready in a few weeks.
My idea is to make use of an app called Dynamic Notifications which is available in the Play Store. For those who don't know, it like the Active Notification found on the Moto X.
So what we can do is replace the icons in the app with the ones similar to the Dot View icons. I have already ripped apart the Dot View App to get my hands on the font used which I have attached below. So using this font we can simple create icons like the one I have attached.
I know it would be inappropriate to modify someone else's work but we could take the permission of the developer and if possible the developer of the app could himself take this project up.
I already tried this but I am kind of novice in app modding and keep getting installation errors.
The icon which I make has white font with transparent background so you might not see the thumbnail but click on it to view it.
Click to expand...
Click to collapse
did you sign the app? that could explain the installation errors
Hi, Of interest if you install NOLed notifications app from market - which should show flashing squares on screen in stead of LED - designed for phones with no LED, but cool with this case as you should see different colours for each app - only odd side effect - it flashes time and weather when you have notifications - not its own squares - would be good if someone could code something without this side affect.
ssojyeti2 said:
did you sign the app? that could explain the installation errors
Click to expand...
Click to collapse
I used APK Manager to decompile and then recompile the .apk file. Do you know of a better way to do the same ?
kfasheldon said:
Hi, Of interest if you install NOLed notifications app from market - which should show flashing squares on screen in stead of LED - designed for phones with no LED, but cool with this case as you should see different colours for each app - only odd side effect - it flashes time and weather when you have notifications - not its own squares - would be good if someone could code something without this side affect.
Click to expand...
Click to collapse
Thanks for sharing, I will try and look into it !
Hey,
I've been trying to do the same thing. I also got stuck at resigning the app.
I'm trying to replace HTC voice assist with Google now.
The logcats implied that I needes to be signed with HTCs certificates. Does that make sense?
Any suggestions?
Sent from my HTC6525LVW using Tapatalk
Finally I was able to over come the signing problem and could get the app to install. The default size of the images used in the app was 216 X 216 which according to me was very small and the icon displayed is as shown in attachment 1.
After which i increased the size to 400 X 400 but sadly the image is now being chopped off from the sides.
This according to me is because of the image size set in the app which I don't know how to edit.
If it would be very kind if someone could help / guide me with this one.
I have also attached the .apk file if anyone is interested in looking into it
David 617 said:
Hey,
I've been trying to do the same thing. I also got stuck at resigning the app.
I'm trying to replace HTC voice assist with Google now.
The logcats implied that I needes to be signed with HTCs certificates. Does that make sense?
Any suggestions?
Sent from my HTC6525LVW using Tapatalk
Click to expand...
Click to collapse
I used this app called APK Edit from the PlayStore to overcome the signature problems
David 617 said:
Hey,
I've been trying to do the same thing. I also got stuck at resigning the app.
I'm trying to replace HTC voice assist with Google now.
The logcats implied that I needes to be signed with HTCs certificates. Does that make sense?
Any suggestions?
Sent from my HTC6525LVW using Tapatalk
Click to expand...
Click to collapse
If you can do this please let me know!
AshritShetty said:
I used this app called APK Edit from the PlayStore to overcome the signature problems
Click to expand...
Click to collapse
You used this - https://play.google.com/store/apps/details?id=com.gmail.heagoo.apkeditor ?
It seems that you can only replace the resources with this but now edit the actual code. Is that true or did I miss something?
David 617 said:
You used this - https://play.google.com/store/apps/details?id=com.gmail.heagoo.apkeditor ?
It seems that you can only replace the resources with this but now edit the actual code. Is that true or did I miss something?
Click to expand...
Click to collapse
Yes, its the same app.
Initially I thought the process will be as easy as replacing the images but now when I see, I need to edit the code to resize the images for which I will have to use the traditional methods like APK Manager.
But editing the code is beyond the scope of my knowledge and so will be looking forward to others.
I'm comfortable editing the code, I'm just lost as to how I repackage and replace the old apk.
Maybe if you find anything on that you can post it here and we can get to work on it together...
Thx
Sent from my HTC6525LVW using Tapatalk
When I make a apk into a signed zip I use this:
https://play.google.com/store/apps/details?id=zip.me
Don't know if it is any relevance to this thread but it's worth a try.
Sent from my HTC One_M8 using Tapatalk
David 617 said:
I'm comfortable editing the code, I'm just lost as to how I repackage and replace the old apk.
Maybe if you find anything on that you can post it here and we can get to work on it together...
Thx
Sent from my HTC6525LVW using Tapatalk
Click to expand...
Click to collapse
I hope this guide is of help to you : http://droidcandy.weebly.com/how-to-use-apk-manager.html
My upcoming Xposed module will include notifications for all apps:
(Text at the bottom auto scrolls to show all text)
And a dialer... http://i.imgur.com/0pzY76H.jpg
And music metadata/controls.
And a game of Snake, cause why not, https://twitter.com/MohammadAG/status/467642113266421760
MohammadAG said:
My upcoming Xposed module will include notifications for all apps:
(Text at the bottom auto scrolls to show all text)
And a dialer... http://i.imgur.com/0pzY76H.jpg
And music metadata/controls.
And a game of Snake, cause why not, https://twitter.com/MohammadAG/status/467642113266421760
Click to expand...
Click to collapse
This is cool!
I recognise your handle. Did you used to frequent Nokia Users forum way back when?
Sent from my HTC One_M8 using Tapatalk
Chris_c81 said:
This is cool!
I recognise your handle. Did you used to frequent Nokia Users forum way back when?
Sent from my HTC One_M8 using Tapatalk
Click to expand...
Click to collapse
NokiaUsers and talk.maemo.org
MohammadAG said:
My upcoming Xposed module will include notifications for all apps:
(Text at the bottom auto scrolls to show all text)
And a dialer... http://i.imgur.com/0pzY76H.jpg
And music metadata/controls.
And a game of Snake, cause why not, https://twitter.com/MohammadAG/status/467642113266421760
Click to expand...
Click to collapse
Awesome work my friend !
Also thank you for creating the 3 Finger Screen Lock Mod :laugh:
But wouldn't it be possible to achieve this without the need to root ? For example by modifying the Dot View App ?
AshritShetty said:
Awesome work my friend !
Also thank you for creating the 3 Finger Screen Lock Mod :laugh:
But wouldn't it be possible to achieve this without the need to root ? For example by modifying the Dot View App ?
Click to expand...
Click to collapse
As an art user I'd love this.
Sent from my 831C using XDA Free mobile app
I'm not a big fan of smali editting, especially with Dot View being a Play Store package, so no, sorry.
Sent from my HTC One_M8 using Tapatalk

[Q] how do file managers retain listview

In most of the file managers present on Google play. when we open a folder and then go back,list view is automatically scrolled to the position from where folder was opened. So either the scroll position or whole list view is saved. I want to ask how this can be implemented?
Sent from my XT1033 using XDA Premium 4 mobile app
arpitkh96 said:
In most of the file managers present on Google play. when we open a folder and then go back,list view is automatically scrolled to the position from where folder was opened. So either the scroll position or whole list view is saved. I want to ask how this can be implemented?
Sent from my XT1033 using XDA Premium 4 mobile app
Click to expand...
Click to collapse
yes, there are a few ways to do it, probably the easiest is just storing the scroll position yourself, much info on SO about this if you google... also complex views like listView save their own bundles too iirc
deanwray said:
yes, there are a few ways to do it, probably the easiest is just storing the scroll position yourself, much info on SO about this if you google... also complex views like listView save their own bundles too iirc
Click to expand...
Click to collapse
Thanks I got it
Sent from my XT1033 using XDA Premium 4 mobile app

[Q] (Help) Android Launcher Code Specifying

I'm trying to make my own icon pack, and I don't know much about xml coding. I've been trying to learn through other people's templates, but I was hoping someone could help explain to me how to target specific launchers. What about the xml coding targets LGHome launcher? I was hoping to make my start there.
-I fully understand DPI, and the sizes of the icons required to work in all forms (mdpi, hdpi, xhdpi, xxhdpi, and xxxhdpi) I also understand that the Google Play icon must be at least 512px x 512px
-I understand file formatting, though I DO NOT KNOW what format would be best in this case to use (I think bitmaps were recommended strongly)
-I have the latest version of Android Studio and Android SDK Standalone
I will be experimenting with codes and icons, but I am unsure of how to test them on one of my own Android Devices (LG G2 & Nexus 10)
Would I upload the file directly to my device once I pack it? How do I make my project into an APK
To target other launchers you need to find package id of the particular launcher and add the same to main activity of your app.
You need to export the file using adt or to test ypu can also run the app in adt and install it in your phone.
Do some google you will understand or co relate what i said
Sent from my LG-D802 using XDA Free mobile app
Spoonfeed required, I'm totally new at this. Where can I find the package id of each individual launcher? I've been Googling how to do this, but it isn't exactly a popular topic, which is why I came here to ask for help.
I will look into everything you said though, thank you.
karmaxdw said:
Spoonfeed required, I'm totally new at this. Where can I find the package id of each individual launcher? I've been Googling how to do this, but it isn't exactly a popular topic, which is why I came here to ask for help.
I will look into everything you said though, thank you.
Click to expand...
Click to collapse
Install apex launcher and tap for 3 sec on the home screen free area. This will open menu and show u shortcut option slext the same and then select activity.
Now scroll down until u find the desired launcher and it will show u the package id.
Ps you need to have launcher installed first to see the package id.
Alternatively, open playstore in pc and search the app you want to see the package id. Open its page and on top it will show you the package id.
Sent from my LG-D802 using XDA Free mobile app
vishal11in said:
Install apex launcher and tap for 3 sec on the home screen free area. This will open menu and show u shortcut option slext the same and then select activity.
Now scroll down until u find the desired launcher and it will show u the package id.
Ps you need to have launcher installed first to see the package id.
Alternatively, open playstore in pc and search the app you want to see the package id. Open its page and on top it will show you the package id.
Sent from my LG-D802 using XDA Free mobile app
Click to expand...
Click to collapse
Thank you, that was very helpful. I'll reply here if I need any more assistance.
karmaxdw said:
Thank you, that was very helpful. I'll reply here if I need any more assistance.
Click to expand...
Click to collapse
No problem let me know
Btw did you try my new lg home theme.
Sent from my LG-D802 using XDA Free mobile app
I may have, which was yours?
Also, I opened the Play Store page for many of the launchers, yet I can't seem to find the ID
Sent from my LG-LS980 using XDA Free mobile app

Resources