Coder Social home page Coder Social logo

Comments (10)

molinch avatar molinch commented on August 20, 2024

ImageViewAsync has two constructors:

public ImageViewAsync(Context context, SizeF? predefinedSize=null)
public ImageViewAsync(Context context, IAttributeSet attrs, SizeF? predefinedSize=null)

I believe that is why you have this issue: there is no constructor with the signature:

System.IntPtr, Android.Runtime.JniHandleOwnership

Could you paste some code here or attach a zip file of your solution?

from ffimageloading.

dasmikko avatar dasmikko commented on August 20, 2024

I'm completely new to Xamarin, but here is my code:

using System;

using Android.App;
using Android.Content;
using Android.Runtime;
using Android.Views;
using Android.Widget;
using Android.OS;
using RestSharp;
using FFImageLoading;
using FFImageLoading.Views;
using FFImageLoading.Helpers;
using FFImageLoading.Extensions;

namespace SimpleshopApp
{
    [Activity (Label = "SimpleshopApp", MainLauncher = true, Icon = "@drawable/icon")]
    public class MainActivity : Activity
    {
        int count = 1;

        protected override void OnCreate (Bundle bundle)
        {
            base.OnCreate (bundle);


            // Set our view from the "main" layout resource
            SetContentView (Resource.Layout.Main);

            // Get our button from the layout resource,
            // and attach an event to it
            Button button = FindViewById<Button> (Resource.Id.myButton);
            ImageViewAsync imgView = FindViewById<ImageViewAsync> (Resource.Id.imageView1);
            var client = new RestClient ("http://xkcd.com/");

            var request = new RestRequest (String.Format ("info.0.json"));

            var asyncHandle = client.ExecuteAsync<Comic>(request, response => {
                var img = response.Data.img;
                Console.WriteLine(img);



            });

            button.Click += delegate {
                button.Text = string.Format ("{0} clicks!", count++);


            };
        }
    }
}

from ffimageloading.

molinch avatar molinch commented on August 20, 2024

Looks like this is a known issue of Xam.Android: http://stackoverflow.com/questions/26573627/no-constructor-found-for-system-intptr-android-runtime-jnihandleownership

Solutions seems to be simple: adding the other constructor and calling the base one.
This is what I just did: 22bed22

Do you have the possibility to test using master's sources?
I can make a new NuGet package once I get your confirmation.

from ffimageloading.

dasmikko avatar dasmikko commented on August 20, 2024

I'm not sure how to :(

from ffimageloading.

molinch avatar molinch commented on August 20, 2024

Don't worry I just made a prerelease NuGet package.
If you go in the Package console in Visual studio you can have it by executing

Install-Package Xam.Android.ImageLoading -Pre

from ffimageloading.

dasmikko avatar dasmikko commented on August 20, 2024

How to, in Xamarin Studio? :)

from ffimageloading.

molinch avatar molinch commented on August 20, 2024

In the Add Nuget package popup search for "imageloading" and tick "Show pre-release packages".
Then you can take the 1.0.2-beta

from ffimageloading.

dasmikko avatar dasmikko commented on August 20, 2024

Still throws the same error.

from ffimageloading.

molinch avatar molinch commented on August 20, 2024

My bad. I think that something went wrong and the nuget doesn't contain the latest changes.
I just removed bin/obj and made a new nuget which is now 1.0.3-beta

from ffimageloading.

dasmikko avatar dasmikko commented on August 20, 2024

Works perfectly now! Thanks!

from ffimageloading.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.