java.awt.event cannot be resolved

I have the error java.awt.event cannot be resolved in the statement:

import java.awt.event.ActionListener;

I'm writing an android application that fires an action (by extending the AbstractAction class) when an SMS is received. I'm implementing the ActionListener interface in another class.

EDIT

The above issue is resolved. Now which classes shall I use that'll let me fire actions like in java swing. Or shall I use another way? I basically need to call a method on another thread.

Answers


I'm writing an android application

Well that's the problem then... Android doesn't support the whole of the AWT; it has its own GUI libraries. See the platform reference documentation for details. It's not clear which AbstractAction class you're talking about, either - is it a third-party one? If so, look at that third-party documentation to see whether another library is required for AWT-like classes.

Have you looked at whether what you're trying to do might be better achieved using the "normal" Android platform API instead? I'd expect that to be simpler.


Java Standard Edition - (AWT + SWING) = Android.

The above statement means that Android doesn't support Swing and AWT from Java SE. Android provides its own GUI library, i think usage of GUI in android is far more easier to construct.


Need Your Help

How to export a complete page+resources from a website to jsFiddle?

jsfiddle

I am working on a website (on localhost) with some fancy interactive js and css.

Ember data from a rest url not rendering

ember.js ember-data

I am trying to create an Ember.js application for the first time using a RESTful backend. I have been always been using HTML rendered from my server and hence I am a newbie to ember.