Add context Menu to private class View

by craigyg121 » Tue, 03 May 2011 04:09:28 GMT


Sponsored Links
 Hi all,

First post and just getting into Android development so please be
patient with me. I would like to implement a context menu / menu of
some kind when a long click is done on the screen. I can do this under
a normal class when it extends the Activity but i am unsure how to do
this under a private class.

I create a new private class to draw certain shapes etc and use the
onDraw method to draw the items. Very similar to
 http://bestsiteinthemultiverse.com/2008/11/android-graphics-example/ 

Once i call the private class i do not see any events in my main class
as expected.

Any help on this would be appreciated.

-- 



Re: Add context Menu to private class View

by TreKing » Tue, 03 May 2011 07:10:53 GMT


 



How do you "call the private class"?
What is your "main class"?
What event are you expecting to see that you don't?

-------------------------------------------------------------------------------------------------
TreKing < http://sites.google.com/site/rezmobileapps/treking> ; - Chicago
transit tracking app for Android-powered devices

-- 


Sponsored Links


Other Threads

1. Error with Eclipse

When I go to Window > Preferences > Android I get this issue:

[2009-11-01 19:48:56 - ddms]Could not open Selected VM debug port
(8700). Make sure you do not have another instance of DDMS or of the
eclipse plugin running. If it's being used by something else, choose a
new port number in the preferences.

And when I select my SDK I still get "No target available" in the
target list.

Because of this I am unable to create a new Android project.

Also, when I select Preferences > Android > DDMS I get an error:

"An error has occurred. See error log for more details."

I'm running Linux Mint 7 and Eclipse 3.2.2.

-- 

2. Starting a service from top-level launcher

Hi,

I am trying to make a 'headless' (i.e. UI-less) application. Is it possible
to start a service in my application from the top-level launcher (the one
accessed from the Android home screen) directly, that is, without the
launcher starting an activity which then start the service?

Simply adding the ACTION_MAIN and CATEGORY_LAUNCHER filters to the
declaration of the service in the manifest file does not work for me.

Thanks in advance,
Anders Feder

-- 

3. Very specific question about Foreground / Background tasks...

4. Could not open Selected VM debug port (8700). [error]

5. Problem with Ubuntu 9.10? Please read!

6. Very specific question about Foreground / Background tasks...

7. How to add View on a Map at specific Geopoint?