You can implement some listener concept

write a interface in your normal java file
and implement that method in activity

then by calling that method in the normal java file you can make a
call to implemented method in activity class

Use handlers to do any Operations in the activity ( in implemented
method - other wise it will give u error)

May be this will help you a little.

On Oct 30, 4:00 pm, Stefan <ebay-dah...@web.de> wrote:
> Hello,
>
> i have following problem:
> I have my "MainActivity". In this Activity, i start a thread
> (SaxParser in another "normal" java file). Now I want to call a method
> from the MainActivity out of the normal java file? I have read
> something of an Application object, but i only find things, where i
> have to create a new Intent (...).
> Is it possible to use the application object in the other "normal"
> java file like that:
>
> Second/normal/SaxParser-file:
>
> public class XMLHandler extends DefaultHandler implements Parcelable
> {
>    ....
>    ConstructorOfSecondJavaFile(  ApplicationObject o)
>    {
>       this.applicationObject = o;
>       ...
>    }
>
>     ...
>     o.callMethodOfMainActivity (int aValue);
>
> }
>
> MainActivity:
>
> private int val;
>
> public class MainAcitivity extends ...Acticity
> {
>   public onCreate (..)
>   {
>      ...
>   }
>
>   public callMethodOfManinActivity (int val)
>   {
>     this.val = val;
>   }
>
> }
>
> Thanks,
> Stefan
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to