view -> parent activity

by Andrei » Thu, 22 Apr 2010 13:17:03 GMT


Sponsored Links
 If I have reference to a view that is on activity
How do I get reference to the activity from view reference?
Thanks

--



view -> parent activity

by ~ TreKing » Thu, 22 Apr 2010 22:05:19 GMT


 



You don't - at least not without maintaining your own mapping or holding a
reference somewhere yourself.
I guess you COULD put the Activity reference in the view's tag ... but that
seems dirty.
Why do you need an Activity? Most everything you need is usually available
from Context, which a view has.

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

--


Sponsored Links


Other Threads

1. ant build problems

HI all,

I'm seemingly having problems creating the apk using an ant build for
1.5. It's building so
I'm guessing the sdk pointer in local.properties is set correctly, but
it seems to not be finding
sun.security.x509.* (?). I can see that jarutils.jar is in

~/android-sdk-linux_x86-1.5_r2/tools/lib/jarutils.jar

and contains:
META-INF/
META-INF/MANIFEST.MF
java-source-list-uniq
com/
com/android/
com/android/jarutils/
com/android/jarutils/DebugKeyProvider$IKeyGenOutput.class
com/android/jarutils/DebugKeyProvider$KeytoolException.class
com/android/jarutils/DebugKeyProvider.class
com/android/jarutils/SignedJarBuilder$SignatureOutputStream.class
com/android/jarutils/SignedJarBuilder$IZipEntryFilter.class
com/android/jarutils/SignedJarBuilder.class
com/android/jarutils/JavaResourceFilter.class
com/android/jarutils/KeystoreHelper$1.class
com/android/jarutils/KeystoreHelper$2.class
com/android/jarutils/KeystoreHelper.class


Here's the traceback spew... any help??


release:
[apkbuilder] Creating .Phresheez-unsigned.apk for release...

BUILD FAILED
java.lang.NoClassDefFoundError: com.android.jarutils.SignedJarBuilder
   at java.lang.Class.initializeClass(libgcj.so.10)
   at com.android.apkbuilder.ApkBuilder.createPackage(ApkBuilder.java:367)
   at com.android.ant.ApkBuilderTask.createApk(ApkBuilderTask.java:286)
   at com.android.ant.ApkBuilderTask.execute(ApkBuilderTask.java:201)
   at org.apache.tools.ant.UnknownElement.execute(ant-1.7.1.jar.so)
   at java.lang.reflect.Method.invoke(libgcj.so.10)
   at org.apache.tools.ant.dispatch.DispatchUtils.execute(ant-1.7.1.jar.so)
   at org.apache.tools.ant.Task.perform(ant-1.7.1.jar.so)
   at org.apache.tools.ant.Target.execute(ant-1.7.1.jar.so)
   at org.apache.tools.ant.Target.performTasks(ant-1.7.1.jar.so)
   at org.apache.tools.ant.Project.executeSortedTargets(ant-1.7.1.jar.so)
   at org.apache.tools.ant.Project.executeTarget(ant-1.7.1.jar.so)
   at 
org.apache.tools.ant.helper.DefaultExecutor.executeTargets(ant-1.7.1.jar.so)
   at org.apache.tools.ant.Project.executeTargets(ant-1.7.1.jar.so)
   at org.apache.tools.ant.Main.runBuild(ant-1.7.1.jar.so)
   at org.apache.tools.ant.Main.startAnt(ant-1.7.1.jar.so)
   at org.apache.tools.ant.launch.Launcher.run(ant-launcher-1.7.1.jar.so)
   at org.apache.tools.ant.launch.Launcher.main(ant-launcher-1.7.1.jar.so)
Caused by: java.lang.ClassNotFoundException: sun.security.x509.AlgorithmId
   at 
org.apache.tools.ant.AntClassLoader.findClassInComponents(ant-1.7.1.jar.so)
   at org.apache.tools.ant.AntClassLoader.findClass(ant-1.7.1.jar.so)
   at org.apache.tools.ant.AntClassLoader.loadClass(ant-1.7.1.jar.so)
   at java.lang.ClassLoader.loadClass(libgcj.so.10)
   at java.lang.Class.initializeClass(libgcj.so.10)
   ...17 more

--~--~---------~--~----~------------~-------~--~----~

2. no classfiles specified and Conversion to Dalvik format failed with error 1

Check this: http://www.anddev.org/viewtopic.php?p=22705

You have to simply reload the project in Eclipse. Click on the project
in the Package explorer on the left and press F5(reload)




--~--~---------~--~----~------------~-------~--~----~

3. manipulating cursor - need to edit column retrieved data before setListAdapter

4. Eclipse 3.3, Android SDK 1.5, adb 1.0.18 running, 1.0.20 needed

5. building android hidden code under frameworks/base/core/java/com/android/internal

6. Add Contact not working

7. Failed to open /dev/mem from Anroid opencore framework