yashsingh1/xdaforums huggingface dataset:
[Java for Android App Development] Saurabh Shah:
[Question]

i need to implement a button that plays sound onclick.

so my BUTTON code is

public class MainActivity extends Activity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);

Button one = (Button)this.findViewById(R.id.button1);
final MediaPlayer mp = MediaPlayer.create(this, R.raw.audio);
one.setOnClickListener(new OnClickListener(){

public void onClick(View v) {
mp.start();
}
});
}

The default code for FirstActivity is

public class FirstActivity extends Fragment{

public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState){
View v = inflater.inflate(R.layout.layout1, null);

return v;
}

}

My BUTTON code should be implemented in FirstActivity.java?

If YES,how should it be written?

If NO, plz correct me if i am wrong.

Thanks in advance.
[Java for Android App Development] MuSaddiq:
DELETED
[Java for Android App Development] SimplicityApks:
Yes, you have to put that code into the onCreateView(...) method of the FirstActivity.java Fragment. I find it quite confusing that the OP has called these classes (FirstActivity, Second...) Activity and not Fragment since there is only one activity, which is MainActivity.

So for your code you have to put it in the Fragment like this:

public class FirstActivity extends Fragment{

public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState){
View v = inflater.inflate(R.layout.layout1, null); // call findViewById on the just inflated View!
Button one = (Button) v.findViewById(R.id.button1); // make sure there is a Button with android:id="@+id/button1" in the layout1.xml file!
final MediaPlayer mp = MediaPlayer.create(this, R.raw.audio);
one.setOnClickListener(new OnClickListener(){

public void onClick(View v) {
mp.start();
}
});

return v;
}

}
[Java for Android App Development] Saurabh Shah:
Thankyou verymuch.

I will try this today.
[Java for Android App Development] Saurabh Shah:
A little bug in your code bro. error in this line.

final MediaPlayer mp = MediaPlayer.create(this, R.raw.audio);

Solved.

final MediaPlayer mp = MediaPlayer.create(getActivity(), R.raw.audio);
[Java for Android App Development] SimplicityApks:
Ya right that's because I don't have an app to test it and am simply writing it in the Xda editor...

So it's working then? Nice!
[Java for Android App Development] Saurabh Shah:
Yeah its working..

But i am facing another problem now :rolleyes:

I tried changing the ImageView resource on button click.

public class FirstActivity extends Fragment{

public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState){
View v = inflater.inflate(R.layout.layout1, null);

Button button1 = (Button) v.findViewById(R.id.button1);

button1.setOnClickListener(new View.OnClickListener() {

[MENTION=439709]override[/MENTION]
public void onClick(View v) {
// TODO Auto-generated method stub

ImageView a= (ImageView) v.findViewById(R.id.imageview1);
a.setImageResource(R.drawable.click);

}
});

return v;

}}

Check this Code.

Is this Correct? I am not geting any compilation error, but the app get error on button click.
[Java for Android App Development] SimplicityApks:
You should not call v.findViewById() in the onClick since the view is certainly gonna be null (isn't it giving you compilation error about v has to be final?). Instead, use getView().findViewById()! Other than that, please check your logs and try to find the error yourself with nikwen's awesome guide on debugging.
[Java for Android App Development] PineappleOwl:
Hello, can I ask for your help, here is my code

This is my first activity, how can I make the onCreateView make it to an intent or make it a class. for example i want to make it Settings next is message and the likes, how can i suppose to do that? :)
[Java for Android App Development] sud007:
Thanks a LOT!!

That worked like a charm...:good:
[Java for Android App Development] sak-venom1997:
Nice guide OP but i seriously feel you should update your OS :p
[Java for Android App Development] :
that's win7 ultimate 64bit not xp (disabled themes)

xd
[Java for Android App Development] david23400:
DELETED
[One (M7) Q&A, Help & Troubleshooting] Syther101:
If for some reason I wanted to return to a stock ROM on my device, is there a site where I can download the latest stock ROM.

For example. I currently have a Nandroid backup of my HTC One's 4.2.2 Sense 5.0 ROM. While this is the latest stock at the moment, if per say when the finally get 4.3, is there a site or perhaps a thread on the forums where people post stock ROMs for their carrier/device.

I have looked about Google but haven't really managed to find much. Or at least resources which looks trustworthy/updated often.

Thanks and sorry for the noob question

Syther101
[One (M7) Q&A, Help & Troubleshooting] Guich:
Read here :)
[One (M7) Q&A, Help & Troubleshooting] Syther101:
Thanks :). Got this bookmarked incase it's ever needed
[HTC One X] cobby911:
I have a HTC ONE X which is HTC_001 it is unlocked to any network as it's sim free does anyone know how to revert back to stock

Other information

ENDEAVORU PVT SHIP S-ON RL

HBOOT - 1.39.0000

CPLD - none

MI CROP - none

RADIO - 5.1204.162.29
[HTC One X] cobby911:
Updated with more information
[HTC One X] herbie13:
Check the post just above yours

http://xdaforums.com/showthread.php?p=45746384

So install the right ruu or matching nandroid backup
[HTC One X] cobby911:
Every RUU I get the process wont work I just keep getting an error
[HTC One X] herbie13:
Post you main version here

Fastboot getvar version-main

And someone should be able to identify if the right one is available for you.
[HTC One X] cobby911:
This is my main - 3.14.401.3

My CID - HTC_001
[HTC One X] herbie13:
Have a look here for a nandroid

http://xdaforums.com/showthread.php?p=33728099

I see you fixed this on another thread. Please ask just the once. Cheers
[HTC One X] Mr Hofs:
Yeah this is what you get when the OP opens more than 1 thread, it gets confusing
[Galaxy S 4 Q&A, Help & Troubleshooting] secguy:
Does anyone know what kind of bootloader does the S4 use, anything on its architecture, if it is locked/unlocked/unlockable, if it prevents flashing system images etc?
[Nexus 7 (2013) Q&A] picespedes:
Hi! I have my nexus 7 2013 wifi about one week ago, i have some small issues with the keyboard but i can get along with it.

What really worries me is that yesterday i noticed it makes a very small noise, just audible if i put my ear next to the device. It is like the sound of a pc proccesor, that increases when i touch the screen and almost dissapear when the screen is off. It doesnt change when its charging or on the table, and umtil now i didnt notice any battery leaks or jumps.

Any ideas of what this could mean? Electrical issues? Can you please verify if your device is making any kind of sound?

Thank you in advance!!

Greetings from chile!!!
[Nexus 7 (2013) Q&A] gman88667733:
do not worry

Do not worry, this is present in all nexus 7 devices. It is something to do with Asus using a crappy speaker part. If you want the full details, Google it or look on here :) you slowly get used to it. I got my N7 last weekend and I never really notice it anymore. So do not worry :)
[Nexus 7 (2013) Q&A] swisstourist:
I don't hear anything....
[Nexus 7 (2013) Q&A] picespedes:
Any other opinion please?
[Nexus 7 (2013) Q&A] sk8trix:
I have also noticed the screen issue a tiny bit but it isn't as bad as people make it out to be.....I had a Nexus 4 in the past so I'm used to the crappy screen sensitivity lol but this device is still amazing and a way better device than my old N7 I guess with time updates will iron out all the kinks.
[Xperia Arc Q&A, Help & Troubleshooting] chiragvagh:
I required

Xperia Honami framework-res.apk

Please share.
[Xperia Arc Q&A, Help & Troubleshooting] Someguyfromhell:
Ask from Xperia Z1/Honami section. Arc users can't get it from anywhere.
[Xperia Arc Q&A, Help & Troubleshooting] kevinrus123:
I think he wants framework-res.apk from Xperia Honami ROM.

Download it again and framework folder contains the .apk
[Sprint Samsung Galaxy S III] babyarm85:
Moderator EDIT...Paypal link and the original post contents removed, this is not in the spirit of XDA, nor is it appropriate as a proper "Bounty Thread", no one should have to donate anything to get anything here, work is done here in and for the spirit of development.
[Sprint Samsung Galaxy S III] Notorious:
Idk if this will work out since you can't generally guarantee that if he buys a S3 he'll get a brand new one with the same issue you guys are having
[Sprint Samsung Galaxy S III] babyarm85:
I

KNOW

exactly which phone he will be getting...(my wifes),so if people have faith then it will get done. and it will cost a lot less than people think.

edit:

when my wife gets home I will take pictures of the exact phone (that Nardholio will be receiving) and myself to help ensure people that this is not a scam. by the way its the purple s3 Nardholio. hope you don't mind.
[Sprint Samsung Galaxy S III] dazednconfused:
So are you giving him your wife's phone or selling it to him? If you are selling it to him, how much are you asking for the donations to cover? Was just curious where the donations came into play.
[Sprint Samsung Galaxy S III] Whiplashh:
I think he is probably buying her a new phone (S3?) To replace that purple one and giving it to the other guy to develop on. If the story is true.

-------------------------

Sprint Galaxy S3

Need Help? PM

Hit the "Thanks" button if I helped you!
[Sprint Samsung Galaxy S III] dazednconfused:
That makes sense, I didn't even think of that.
[Sprint Samsung Galaxy S III] :
I've communicated with him and believe him. I've even given him $5 even though the phone is for me lol
[Sprint Samsung Galaxy S III] babyarm85:
Lets just say I have my ways of being a procurement specialist...and im the real deal. Its just that this is the first time I actually have something that I can contribute to android development and xda. I am the antichrist of iphone.

And with 5 bucks the ball is rolling. I know a lot of people have doubts but some people actually like the satisfaction it gives them to be able to do the right thing. And for even more proof give me a few minutes. I think im going to start doing screen shots to show where we are with donations (for the non-believers).
[Sprint Samsung Galaxy S III] Naddict:
Sorry folks, thread closed...This was not a proper "bounty thread"

This is not how things are done here, see OP for edited info by me.

K.G. EDIT: Lying to the insurance company would be considered fraud and that has no place for discussion on XDA. Allowing threads to beg for money to pay the deductible would make XDA an accessory.
[Sprint LG Optimus G] bigfdaddy2:
Well here is cwm touch touch for our device ... It is being pushed to recovery manager so should be there in next 24-48hrs ... This is the latest version ...

Download :

recovery.img - 8.72 MB

Thnxs spleef for flashable : http://d-h.st/Y5F
[Sprint LG Optimus G] SlimMan:
Hmm, have you tried this?

I have always been a fan of CWM but when coming to this phone I read that CWM didn't play nice with the phone and the devs didn't use it much if any.

Thanks!
[Sprint LG Optimus G] bigfdaddy2:
Yes cause I built it and is being pushed to cwm recovery manager ....
[Sprint LG Optimus G] gitit20:
What's the benefits of this over TWRP? I had CWM on this phone but restore would not work so good to here this is fixed now :) good work may give it a try one of these days no need to as of yet...
[Sprint LG Optimus G] jjairal:
Nice. Can we push data while on recovery with this?
[Sprint LG Optimus G] bigfdaddy2:
U mean adb?
[Sprint LG Optimus G] spleef:
Woohoo wtg bfd...I actually bought the app back in the day so this is interesting... curious how the new cwm works compared to twrp

had to try it made a flashable zip heres link looks good thanks bfd if you want me to remove link just let me know and its gone..thanks again for bringing us official cwm

http://d-h.st/Y5F
[Sprint LG Optimus G] bigfdaddy2:
If ya don't mind I'll throw up top in my DL section
[Sprint LG Optimus G] spleef:
Of course not go for it home skillet.. Ive flashed it myself so I know it works
[Sprint LG Optimus G] bigfdaddy2:
Thnxs I know it works to lol...
[Sprint LG Optimus G] bigfdaddy2:
Know I'm downloading miui sources to build that ....I may become a ROM builder yet lol... And of course I take the hard ones to be my firsts lol...
[Sprint LG Optimus G] spleef:
Yeah buddy that's a serious task there bud though I think your more than capable.. Can't wait miui was one of my favorites
[Sprint LG Optimus G] EFEXR:
I'd hate to ask but what are the features? any screenshots?

I feel like TWRP is official and has so much to read in details about all of its features and CWM Touch has a link with no features?
[Sprint LG Optimus G] bigfdaddy2:
Idk how to screenshot in recovery....
[Sprint LG Optimus G] jjairal:
I meant mount like mass storage device to pc while in recovery.
[Sprint LG Optimus G] bigfdaddy2:
on ubuntu it doesnt for me .... idk if it does for anyone else...
[Sprint LG Optimus G] spleef:
hit this link up will tell you everything you need to know about CWM touch recoveries

http://xdaforums.com/wiki/ClockworkMod_Recovery
[Sprint LG Optimus G] shabbypenguin:
miui source? last i knew it was closed source.
[Sprint LG Optimus G] bigfdaddy2:
Thanks spleef
[Sprint LG Optimus G] bigfdaddy2:
It is but their is a way to build it ....I'm not going to since they haven't updated to 4.3 yet tho .... I got ahead of my self on that one ....
[Sprint LG Optimus G] spleef:
Think they have some stuff on github but not all... think something about miui patch rom can't remember the exacts
[Sprint LG Optimus G] bigfdaddy2:
Yea mipatch
[Sprint LG Optimus G] spleef:
Here link to their github

https://github.com/MiCode
[Sprint LG Optimus G] treezy26:
I've always used cwm until this phone I was forced to use twrp which is ok. My question now I guess is, will cwm be able to read my backups from twrp?

Idk how I got here...
[Sprint LG Optimus G] hazedabeast:
Nice thanks for the recovery! And its official!
[Sprint LG Optimus G] shabbypenguin:
wait you guys honestly didnt have any recovery other than twrp? had i known i woulda gave everyone OUDHS recovery ages ago when mysteryemotionz got the lgog.
[Sprint LG Optimus G] bigfdaddy2:
There was an old version of cwm around but that's the only other option people had besides twrp .... Know we at least have the latest cwm and latest twrp ....

Sent from my fingertips to you're eyeballs !
[Sprint LG Optimus G] bigfdaddy2:
Idk I don't keep backups

Sent from my fingertips to you're eyeballs !
[Sprint LG Optimus G] hazedabeast:
Ha its all good :cool::D:thumbup:
[Sprint LG Optimus G] VoluntaryMan:
Here's 6.0.4.4 in case anybody wants to keep their version current.

Touch version (obviously?)
[Sprint LG Optimus G] bigfdaddy2:
Ty voluntary haven't been keeping up as I should
[Sprint LG Optimus G] VoluntaryMan:
np just figured I'd share it since I was building it for myself.
[Sprint LG Optimus G] iamterence:
Hey man, everything going good with your PA build? I meant to download and try it out when I seen it, but I forgot and can't remember where you posted it, lol.
[Sprint LG Optimus G] VoluntaryMan:
It didn't boot for me, wouldn't flash with TWRP and just hung at the bootlogo when flashed with CWM.

I'm trying a few new things and will post a thread as soon as I get a build actually working.
[Sprint LG Optimus G] Whiplashh:
Can anyone tell me how well backups work with this? I prefer CWM over TWRP but if TWRP is the only one that really works....
[Sprint LG Optimus G] VoluntaryMan:
Here is 6.0.4.5

Enjoy.
[Sprint LG Optimus G] oohaylima:
Where did you get the update?
[Sprint LG Optimus G] VoluntaryMan:
I compiled it.
[Sprint LG Optimus G] oohaylima:
I salute you sir. Works great! Is it possible that you can teach me or direct me to a source that can?
[Sprint LG Optimus G] VoluntaryMan:
the easiest way to do it for devices that have official cm support is to:

1. go to builder.clockworkmod.com

2. "existing devices" tab

3. select the device and check the box for touch

4. click the build button and then follow the link to the build server where you can see your build happening.
[Sprint LG Optimus G] iamterence:
Flashable zip, anyone? I currently have no computer to manually push the recovery to my device. :(
[Sprint LG Optimus G] jblazea50:
Why not download the recovery image onto your phone and use Flashify app to flash the recovery img?

It works great.
[Sprint LG Optimus G] VoluntaryMan:
Unless you've wiped everything and have no OS...

Here is a new version that not only has the new android background with animations but also supports the use of roms built for the target device "geespr".
[Sprint LG Optimus G] oohaylima:
How do we make our own flashable file?
[Sprint LG Optimus G] Smyc151:
Does this allow the flashing of 4.4 ROMs?
[Sprint LG Optimus G] VoluntaryMan:
I'm not sure about roms like omni or psx but it worked perfectly for cm11...

It won't hurt anything to try it out and it will probably work.

As I understand it, the problem with flashing 4.4 is that the recovery needs selinux support. This recovery should have that enabled :)
[Sprint LG Optimus G] Smyc151:
I'll give it a shot tonight. Thanks! Haven't used CWM since the original Evo 4G. Looking forward to trying it out again!
[Sprint LG Optimus G] VoluntaryMan:
I just switched from TWRP myself. CWM has gotten much better.

That link I posted is not a build with touch support, if you want one with touch I can build one easily.
[Sprint LG Optimus G] oohaylima:
Where did you get CM11 at?
[Sprint LG Optimus G] VoluntaryMan:
Knock yourself out.
[Sprint LG Optimus G] Smyc151:
I didn't get a chance to work with it tonight; life got in the way. But tomorrow I'll definitely give it a shot!

And if it's no trouble, it'd be kind of cool to have touch. But I'm happy to use non-touch if it's any work at all :thumbup:

thanks again!
[Sprint LG Optimus G] VoluntaryMan:
Once the site that makes touch builds is back online I'll make one.

It went down on the 4th, presumably because of cm-11.0 stuff.
[Sprint LG Optimus G] VoluntaryMan:
Finally got some uptime on the build server. So here you go:

6.0.4.6 touch
[Sprint LG Optimus G] oohaylima:
Was just about to build it. Good lookin out brother!
[Sprint LG Optimus G] VoluntaryMan:
ClockworkMod Version 6.0.4.7

Touch & Non-Touch
[Sprint LG Optimus G] AOKPBrownNoser:
UJust wondering if anyone could help me out here.

But how can I access the portion of the Internal that CWM uses? I've Tried connecting to PC, Rom Toolbox Pro, CM File Manager, Airdroid and countless other's but I cannot seem to access the same portion of my Internal that CWM needs It always finds no files when I try to flash a zip. And now im stuck with it cause I cant flash recoveries and can't get back to TWRP cause I have no Idea where to move the Files. Any advice will help. I've got multiple Dir. I've got root>Storage> Emulated (>Legacy(Not it) and >0(Not it) | SdCard0 (not it.) |SDCard1 (Also Not it.) and Nothing is in root>SD. Got a serious File Clusterf--- going on here. Any help is appreciated.

Edit- Sorry for this post. I found out my issue. Sorry for the bother.
[Sprint LG Optimus G] dolfinfan:
i have been getting this update notification for the last couple days, and it wants me to upgrade my lg optimus g from LS970ZVB to LS970ZVC. The phone is rooted i might add, is it safe for me to do this update without losing the root access?
[Sprint LG Optimus G] simpkill:
You'll probably loose root. If you have ANY custom ROM installed even stock, I wouldn't do it without first restoring the original stock software.
[Sprint LG Optimus G] padalua:
It is safe to update but, you'll lose root. The good news is that you can unlock and root your phone using the same method as ZVB.
[Sprint LG Optimus G] GroundSkor:
I am unlocked and rooted. I didn't change anything and took the ota update. It rebooted phone to twrp and that's it. Then I rebooted to system. So how do I go about locking and unrooting before taking update? Or can you do it from custom recovery?
[Sprint LG Optimus G] engine95:
ZVC will install through TWRP. Then you'll have to root and unlock again just like ZVB.
[Sprint LG Optimus G] toddjunk:
I'm not sure what I did wrong, but it did not install at TWRP

Stock LS970ZVB that has been unlocked. Treat me like I'm 5. When I get to the TWRP screen, what should I be doing?

And how do I get it to tell me to update again? I remember there was a way to make it search for updates (but some sort of cache needed to be cleared before it would look again, etc)?

thank you
[Sprint LG Optimus G] engine95:
If I remember right, if it didn't install, and you rebooted, i think it disappears. With a root explorer, look in /cache or /cache/fota and see if it's there. If not, you can get the update in the root guide. Follow the instructions to manually update.

I can't remember what to clear to get the update again. Try update profile/prl, then lg update.
[Sprint LG Optimus G] toddjunk:
Went ahead and looked in there and it was empty

I found what to do, but I don't recommend it:

"go to Google services framework….force stop it….clear data and then leave then try to update"

It downloaded the update, then rebooted, and didn't go to TWRP this time. Just straight to the Android with his belly open and the crystal turning. It fails after 30% and you have the Android on his back with a red triangle that has an exclamation point in it. I've rebooted three times and it fails everytime. If I let it sit, instead of rebooting, it eventually go into a normal boot and everything loads on the phone fine, but it's still ZVB.

I will attempt your guide later tonight. Thank you for your help and I pass the above information on not as a complaint, but as a warning of something that might *possibly* happen to others.
[Sprint LG Optimus G] googolplex_:
Is there a way to stop the update notification?

I did root the phone as well, but I really don't want to install this new upgrade just yet. The update notification is driving me nuts, there are time where it pops up every 10 min or so. I tried freezing some processes, but it always comes back. Does anyone know what to do so I can completely stop it for a while? Also, I can't find the location where this upgrade is saved, tried /cache and the SDCARD but no luck. thanks for any help that anyone could provide!
[Sprint LG Optimus G] engine95:
Bottom of the op. http://xdaforums.com/showthread.php?p=43983721. The build prop does work. Look in/cache/fota
[Sprint LG Optimus G] googolplex_:
great, thank you!
[Sprint LG Optimus G] googolplex_:
For those like me who don't know much, the instructions in the link above work

Disable nag screen - 1. Not for sure. Go to /system/app, rename/delete LGFOTA.apk/odex. 2. Edit the build.prop - theres 3 references to ZVB. Change them to ZVC

but you will need to remount /system, I found that x-plore can be allowed to run as su and automatically remount read only systems. I edited the file from there and changed the 4 references from ZVB to ZVC and reboot.

Thanks again!
[Sprint LG Optimus G] engine95:
Notepad++, and apps in the Play Store, can edit build props also.
[MDA, XDA, 1010 General] Krischu:
Strange, I had about 450 MB of TomTom N5 maps (BNL, D) on my 1GB SD. All used to work fine until I decided to write an additional 350 MB of France map material onto the SD.

Suddenly my TTN5 said it had no maps found. When looking into the

SD card with WM 2003 explorer it showed empty (!!).

But putting the card into the USB SD reader attached to my notebook I could see all files and directories.

Strange. Could it be that WM 2003 cannot cope with +512 MB amounts of data in files and directories. Hard to believe but I'm clueless.