Search...
FAQs
Subscribe
Pie
FAQs
Recent topics
Flagged topics
Hot topics
Best topics
Search...
Search within Android
Search Coderanch
Advance search
Google search
Register / Login
Post Reply
Bookmark Topic
Watch Topic
New Topic
programming forums
Java
Mobile
Certification
Databases
Caching
Books
Engineering
Micro Controllers
OS
Languages
Paradigms
IDEs
Build Tools
Frameworks
Application Servers
Open Source
This Site
Careers
Other
Pie Elite
all forums
this forum made possible by our volunteer staff, including ...
Marshals:
Campbell Ritchie
Jeanne Boyarsky
Ron McLeod
Paul Clapham
Liutauras Vilda
Sheriffs:
paul wheaton
Rob Spoor
Devaka Cooray
Saloon Keepers:
Stephan van Hulst
Tim Holloway
Carey Brown
Frits Walraven
Tim Moores
Bartenders:
Mikalai Zaikin
Forum:
Android
Is there any problem with this code?
D Hagy
Greenhorn
Posts: 12
posted 12 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
It produce the stopped unexpectedly problem when I push the search button.
public class beautiful extends Activity { ImageView radar; @Override protected void onCreate(Bundle savedInstanceState) { // TODO Auto-generated method stub super.onCreate(savedInstanceState); this.requestWindowFeature(Window.FEATURE_NO_TITLE); this.getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, WindowManager.LayoutParams.FLAG_FULLSCREEN); setContentView(R.layout.beautiful); radar = (ImageView) findViewById(R.id.radar); Button search = (Button) findViewById(R.id.magnifier); ImageView text = (ImageView) findViewById(R.id.text); MediaPlayer siren = MediaPlayer.create(this, R.raw.siren); search.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { // TODO Auto-generated method stub Thread counter = new Thread(new Runnable(){ @Override public void run() { // TODO Auto-generated method stub try{ Thread.sleep(2000); radar.setImageResource(R.drawable.radar_new_full); Thread.sleep(3000); radar.setImageResource(R.drawable.radar_new_50); Thread.sleep(2000); radar.setImageResource(R.drawable.radar_new_found); } catch (InterruptedException e) { // TODO Auto-generated catch block e.printStackTrace(); } finally{ } } }); counter.start(); } }); }
James Elsey
Ranch Hand
Posts: 231
I like...
posted 12 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
What does the stack trace say in the console?
Also, if you don't intend to do anything in the finally block, you might aswel remove it.
Consider Paul's
rocket mass heater
.
reply
reply
Bookmark Topic
Watch Topic
New Topic
Boost this thread!
Similar Threads
Can I use this code to take a photo and display it?
Android: Cannot show more than one image
I can't show random images in Android
Two Buttons - Only one works?
java.lang.Integer error
More...