Thanks for your help,
so i have my main activity MyActivity then in the popdown shown when
viewButton is pressed there is another button and when that is pressed i
need to call a function that is part of my view GraphView.
Any help would be great.
Parts of My code is below please let me know if any more is needed.
public class MyActivity extends Activity {
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.mainscreen);
viewButton = (ImageButton) this.findViewById(R.id.ViewButton);
viewButton.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
ViewPopupWindow vw = new ViewPopupWindow(v);
vw.setContext(getApplicationContext());
vw.showLikePopDownMenu(-10,0,false);
vw.setOnDismissListener(new PopupWindow.OnDismissListener ()
{
@Override
public void onDismiss() {}});
}
});
GraphView graphView = new GraphView(this);
LinearLayout ll = (LinearLayout)findViewById(R.id.graph);
ll.addView(graphView);
}
//===========================================
class ViewPopupWindow extends BetterPopupWindow {
Context context;
ImageButton lock, unlock, mode0, mode1, mode2;
public ViewPopupWindow(View anchor) {
super(anchor);
}
public void showLikePopDownMenu()
{
super.showLikePopDownMenu(false);
}
@Override
protected void onCreate() {
// inflate layout
LayoutInflater inflater =
(LayoutInflater)
this.anchor.getContext().getSystemService(Context.LAYOUT_INFLATER_SERVICE);
ViewGroup root = (ViewGroup) inflater.inflate(R.layout.viewpick, null);
lock = (ImageButton) root.findViewById(R.id.lockAxisButton);
lock.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
//I want to call a function in GraphView here!
}
});
unlock = (ImageButton) root.findViewById(R.id.unlockAxisButton);
unlock.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
//I want to call a function in GraphView here!
}
});
this.setContentView(root);
}
public void setContext(Context c)
{context = c;}
}
--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en