java - how to go from swing to android for view updating? -


new android programming trying have piece of code wrote time using swing. looking able convert same in android. interface code , class code below:

the interface:

public interface cellview {   void update();   jcomponent getcomponent(); } 

the class

public class componentcellview implements cellview {   private jcomponent component;   public componentcellview(jcomponent component) {     this.component = component;   }   public void update() { component.repaint(); }   public jcomponent getcomponent() { return component; } } 

is there equivalent functionality in android such .repaint() or ability call , return particular view? have heard little invalidate() method may in , believe getview method exists adapters maybe may need declare own custom view. thoughts? thanks

i have worked briefly swing, dont equivalent features looking for. i'll confirm few have mentioned.

  • invalidate() works , call ondraw() method of view again.
  • adapters have getview() method can request.
  • a custom view example -

    view myview = new view (myactivity.this) {      @override     protected void ondraw(canvas canvas) {         // todo auto-generated method stub         super.ondraw(canvas);     }  }; 

Comments

Popular posts from this blog

php - Why I am getting the Error "Commands out of sync; you can't run this command now" -

linux - Does gcc have any options to add version info in ELF binary file? -

java - Are there any classes that implement javax.persistence.Parameter<T>? -