Hi chaps,
It's that time of year again, Barx tries his hand at a library. I really thought this one would be easy but I have fell at the first hurdle. I wish to make a Context Menu library ContextMenu | Android Developers
And following the usage example Android: Context menu example (on long press, gridview) | Stealthcopter.com
I created a pretty standard header for a lib.
I'm guessing as this has to do with UI stuff I need the @ActivityObject?
OK the first instruction in the example is
I tried this 'as is' replacing btn for a view passed in the Initialize method. that create an error. I think i managed to get that bit sorted with
The next step is to override the onCreateContextMenu. This is where I am stuck, I know I didn't get far lol. but i'm trying.
Any pointers?
Tried this but gives error
Also I set my class to extend AbsObjectWrapper like this
No idea if this is the right thing to do.
Been a long time since I messed with libs :signOops:
Any pointers would be great thanks.
It's that time of year again, Barx tries his hand at a library. I really thought this one would be easy but I have fell at the first hurdle. I wish to make a Context Menu library ContextMenu | Android Developers
And following the usage example Android: Context menu example (on long press, gridview) | Stealthcopter.com
I created a pretty standard header for a lib.
B4X:
package barxdroid.contextmenu;
import anywheresoftware.b4a.AbsObjectWrapper;
import anywheresoftware.b4a.BA;
import anywheresoftware.b4a.BA.ActivityObject;
import anywheresoftware.b4a.BA.Events;
import anywheresoftware.b4a.BA.ShortName;
import anywheresoftware.b4a.BA.Author;
import anywheresoftware.b4a.BA.Version;
import android.view.ContextMenu;
import android.view.View;
import android.view.ContextMenu.ContextMenuInfo;
@ActivityObject
@ShortName("ContextMenu")
@Author("Barx")
@Version(1F)
@Events(values={"Click(ID as INT)"})
I'm guessing as this has to do with UI stuff I need the @ActivityObject?
OK the first instruction in the example is
B4X:
registerForContextMenu(btn);
I tried this 'as is' replacing btn for a view passed in the Initialize method. that create an error. I think i managed to get that bit sorted with
B4X:
ba.activity.registerForContextMenu(RegisterView);
The next step is to override the onCreateContextMenu. This is where I am stuck, I know I didn't get far lol. but i'm trying.
Any pointers?
Tried this but gives error
B4X:
@Override
public void onCreateContextMenu(Menu menu, View v, ContextMenuInfo menuinfo) {
}
Also I set my class to extend AbsObjectWrapper like this
B4X:
public class contextmenu extends AbsObjectWrapper<ContextMenu>{
Been a long time since I messed with libs :signOops:
Any pointers would be great thanks.