[Monodroid] How to load Assets outside of an Activity?

Amir Waldman amirw2k at gmail.com
Tue Mar 1 13:23:45 EST 2011


I checked it again. [Application] attribute is there, and following shows
'obj/Debug/android/AndroidManifest.xml'. However, the constructor is not
called, and Instance stays null...

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
android:versionCode="1" android:versionName="1.0"
package="MonoDroidApplication2.MonoDroidApplication2">
  <application android:name="monodroidapplication2.MyApp">
    <activity android:label="MonoDroidApplication2"
android:name="monodroidapplication2.Activity1">
      <intent-filter>
        <action android:name="android.intent.action.MAIN" />
        <category android:name="android.intent.category.LAUNCHER" />
      </intent-filter>
    </activity>
    <provider android:name="mono.MonoRuntimeProvider"
android:initOrder="2147483647"
android:authorities="MonoDroidApplication2.MonoDroidApplication2.__mono_init
__" />
  </application>
  <uses-permission android:name="android.permission.INTERNET" />
</manifest>


Regards,
Amir
-----Original Message-----
From: monodroid-bounces at lists.ximian.com
[mailto:monodroid-bounces at lists.ximian.com] On Behalf Of Jonathan Pryor
Sent: Tuesday, March 01, 2011 7:54 PM
To: monodroid at lists.ximian.com
Subject: Re: [Monodroid] How to load Assets outside of an Activity?

On Mar 1, 2011, at 12:43 PM, Amir Waldman wrote:
> I tried the Application example, but I'm not sure who's responsible for
> instantiating it.

Android is supposed to instantiate it during process startup. Did you
include the [Application] attribute?

Additionally, [Application] is used to generate the /manifest/application
element within AndroidManifest.xml, and if the /manifest/application already
exists within Properties\AndroidManifest.xml, it won't get recreated (and
thus won't emit the /manifest/application/@android:name attribute).

To confirm, check e.g. obj/Debug/android/AndroidManifest.xml and see if the
<application/> element has an android:name attribute.

 - Jon

_______________________________________________
Monodroid mailing list
Monodroid at lists.ximian.com

UNSUBSCRIBE INFORMATION:
http://lists.ximian.com/mailman/listinfo/monodroid



More information about the Monodroid mailing list