Highlighted

Problem with FragmentActivity

New Here ,
Oct 21, 2014

Copy link to clipboard

Copied

A write native extension for android to display "Better pickers" https://github.com/derekbrameyer/android-betterpickers. To display components from this library I wrote Activity extends FragmentActivity to get FragmentManager. I named my class OpenCalendarPickerActivity.  Now I have a problem (from logcat): "Unable to resolve superclass of Lcom/insolutions/nativepickers/OpenCalendarPickerActivity" and "Link of class 'Lcom/insolutions/nativepickers/OpenCalendarPickerActivity;' failed". I include classes from android-support-v4.jar into my project - no result, I try use platform.xml with packagedDependencies tag to include this jar into ane - no result. I can't make this work. PLEASE HELP.

TOPICS
Development

Views

886

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more

Problem with FragmentActivity

New Here ,
Oct 21, 2014

Copy link to clipboard

Copied

A write native extension for android to display "Better pickers" https://github.com/derekbrameyer/android-betterpickers. To display components from this library I wrote Activity extends FragmentActivity to get FragmentManager. I named my class OpenCalendarPickerActivity.  Now I have a problem (from logcat): "Unable to resolve superclass of Lcom/insolutions/nativepickers/OpenCalendarPickerActivity" and "Link of class 'Lcom/insolutions/nativepickers/OpenCalendarPickerActivity;' failed". I include classes from android-support-v4.jar into my project - no result, I try use platform.xml with packagedDependencies tag to include this jar into ane - no result. I can't make this work. PLEASE HELP.

TOPICS
Development

Views

887

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Oct 21, 2014 0
New Here ,
Oct 23, 2014

Copy link to clipboard

Copied

Anyone can help? I also include with

jar -uf nativepickers.jar android

android-support-v4.jar into my ane jar. It didn't help.

My platform.xml for android-arm :

<platform xmlns="http://ns.adobe.com/air/extension/15.0">

  <packagedDependencies>

    <packagedDependency>android-support-v4.jar</packagedDependency>

  </packagedDependencies>

  <packagedResources>

    </packagedResources>

</platform>

ane compiled ok with no error, size od ane file increases btu still i got this error from logcat:

Unable to resolve superclass of Lcom/insolutions/nativepickers/OpenCalendarPickerActivity; (159)

Link of class 'Lcom/insolutions/nativepickers/OpenCalendarPickerActivity;' failed

Could not find class 'com.insolutions.nativepickers.OpenCalendarPickerActivity', referenced from method com.insolutions.nativepickers.OpenCalendarPicker.call

My class OpenCalendarPickerActivity:

package com.insolutions.nativepickers;

import android.app.Fragment;

import android.content.Intent;

import android.os.Bundle;

import android.support.v4.app.FragmentActivity;

import android.view.LayoutInflater;

import android.view.View;

import android.view.ViewGroup;

import com.doomonafireball.betterpickers.calendardatepicker.CalendarDatePickerDialog;

import com.doomonafireball.betterpickers.calendardatepicker.CalendarDatePickerDialog.OnDateSetListener;

public class OpenCalendarPickerActivity extends FragmentActivity {

@Override

  protected void onCreate(Bundle savedInstanceState) {

        CalendarDatePickerDialog calendarDatePickerDialog = CalendarDatePickerDialog.newInstance(new OnDateSetListener() {

  @Override

  public void onDateSet(CalendarDatePickerDialog dialog, int year,

  int monthOfYear, int dayOfMonth) {

  Intent result = new Intent();

  result.putExtra("yearUTC", year);

  result.putExtra("monthUTC", monthOfYear);

  result.putExtra("dateUTC", dayOfMonth);

  setResult(RESULT_OK, result);

  finish();

  }

  }, 2014, 10, 20);

       calendarDatePickerDialog.show(getSupportFragmentManager(), "tag");

  }

I include jar in my android ane project lie this:  fa1.jpg

And I start my Activity with code:

package com.insolutions.nativepickers;

import android.content.Context;

import android.content.Intent;

import android.util.Log;

import com.adobe.fre.FREContext;

import com.adobe.fre.FREFunction;

import com.adobe.fre.FREObject;

public class OpenCalendarPicker implements FREFunction {

static final int SELECT_DATE_RESULT = 10001;  // The request code

@Override

  public FREObject call(FREContext context, FREObject[] data) {

  // TODO Auto-generated method stub

  Context appContext = context.getActivity().getApplicationContext();

  int yearUTC = 0,monthUTC=0,dateUTC = 0;

  try

  {

  yearUTC = data[0].getAsInt();

  monthUTC = data[1].getAsInt();

  dateUTC = data[2].getAsInt();

  }

  catch (Exception e)

  {

  Log.e("nativepickers", "Motyla noga!");

  }

  Intent intent = new Intent(appContext, OpenCalendarPickerActivity.class);

  intent.putExtra("yearUTC", yearUTC);

  intent.putExtra("monthUTC", monthUTC);

  intent.putExtra("dateUTC", dateUTC);

  context.getActivity().startActivityForResult(intent, SELECT_DATE_RESULT);

  return null;

  }

}

And I compile ANE with this command:

/Applications/Adobe\ Flash\ Builder\ 4.7/eclipse/plugins/com.adobe.flash.compiler_4.7.0.349722/AIRSDK/bin/adt -package -target ane NativePickers.ane extension.xml -swc NativePickers.swc -platform Android-ARM -platformoptions platform-android.xml -C android .

And my extension.xml file:

<extension xmlns="http://ns.adobe.com/air/extension/15.0">

    <id>com.insolutions.nativepickers</id>

    <versionNumber>1.0.0</versionNumber>

    <platforms>

        <platform name="Android-ARM">

            <applicationDeployment>

                <nativeLibrary>nativepickers.jar</nativeLibrary>

  <initializer>com.insolutions.nativepickers.NativePickers</initializer>

            </applicationDeployment>

        </platform>

       

     

    </platforms>

</extension>

Any ideas?

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Oct 23, 2014 0
Explorer ,
Apr 23, 2015

Copy link to clipboard

Copied

Hi,

did you solve it?

thanks!

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Apr 23, 2015 0