Thursday 15 September 2011

Android Structure -



Android Structure -

more info

i have doubts android construction of app i´m trying develop, i´m not expert, amateur , curious guy.

i got clear answers guys , i´m thankful it. have been doing right, need tell me so.

structure -

mainactivity - buttona - buttonb - buttonc - buttond - buttone - button f

activitya - buttona1 - buttona2 - buttona3 - buttona4 activityb - buttonb1 - buttonb2 - buttonb3 - buttonb4 activityc - buttonc1 - buttonc2 - buttonc3

settings - name - date - numbers -

layouts: got right function: ready go this i´m trying do

-each button of each activity (above) start short drawableanimation of 30 images tops.

-each drawableanimation repeat continuously.

questions

the app start without problems, each button start new drawableanimation without problem, app don´t clean memory used after finish 1 drawableanimation, out of memory error, how can prepare this? there way clean memory after 1 drawableanimation , before new 1 starts?

when drawableanimation start on activity different mainactivity (second, third, etc) homecoming mainactivity or quit because out of memory error. happening here?

the app have record how many times button click, how can this?

code start each drawableanimation private void addlisteneronbutton() { view = (imageview) findviewbyid(r.id.image); button = (button) findviewbyid(r.id.startanimation); button.setonclicklistener(new view.onclicklistener() { @override public void onclick(view arg0) { frameanimation.stop(); frameanimation = null; view.setbackgroundresource(r.drawable.animation01); frameanimation = (animationdrawable) view.getbackground(); frameanimation.start();

i seek stop or clean memory using frameanimation.stop(); frameanimation = null; does´t work.

1.yes, mainactivity default activity, can alter "launcher" activity in androidmanifest file. line below defines launcher activity

<category android:name="android.intent.category.launcher" />

however, should not "mainactivity.xml", "activity_main.xml", because android's convention sensitive letter cases. java file "mainactivity.java". if want new screen, should create new activity(e.g. secondactivity.java) layout(e.g. activity_second.xml). there alternative ways alter screen, illustration hiding , showing new views in single layout file more advanced.

2.you can start new activity current activity. example, if want start secondactivity mainactivity, first should declare intent;

intent intent = new intent(mainactivity.this, secondactivity.class);

then start this;

startactivity(intent);

you can locate illustration in setonclicklistener method.

3.not sure wanted in one.

android structure

No comments:

Post a Comment