当前位置: 首页>>代码示例>>Java>>正文


Java FREContext.getActivity方法代码示例

本文整理汇总了Java中com.adobe.fre.FREContext.getActivity方法的典型用法代码示例。如果您正苦于以下问题:Java FREContext.getActivity方法的具体用法?Java FREContext.getActivity怎么用?Java FREContext.getActivity使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在com.adobe.fre.FREContext的用法示例。


在下文中一共展示了FREContext.getActivity方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: call

import com.adobe.fre.FREContext; //导入方法依赖的package包/类
/**
 * Process the Call.
 * 
    * @param ctx Extension context used to invoke the method
    * @param args Collection of the parameters passed to the method, one FREObject for each parameter.
    * 
 * @return Returning FREObject
 */
@Override
public FREObject call(FREContext context, FREObject[] args) {
	// Try to process the call
	try {
		// Get The Extension Context and Activity
		ExtensionContext cnt	= (ExtensionContext) context;
		Activity act			= context.getActivity();
		cnt.log(CLASS+"call");
		// Set the passed parameter
		String bannerId			= args[0].getAsString();
		String adMobId			= args[1].getAsString();
		int adSize				= args[2].getAsInt();
		int posType				= args[3].getAsInt();
		int position			= args[4].getAsInt();
		// Get the Extension context instance
		cnt.createBanner(act,bannerId,adMobId,adSize,posType,position);
	} catch (Exception e) {
		// Print the exception stack trace
		e.printStackTrace();
	}
	// Return
	return null;
}
 
开发者ID:mnashwan,项目名称:AdMobAne,代码行数:32,代码来源:CreateBanner.java

示例2: call

import com.adobe.fre.FREContext; //导入方法依赖的package包/类
/**
 * Process the Call.
 * 
    * @param ctx Extension context used to invoke the method
    * @param args Collection of the parameters passed to the method, one FREObject for each parameter.
    * 
 * @return Returning FREObject
 */
@Override
public FREObject call(FREContext context, FREObject[] args) {
	// Try to process the call
	try {
		// Get The Extension Context and Activity
		ExtensionContext cnt	= (ExtensionContext) context;
		Activity act			= context.getActivity();
		cnt.log(CLASS+"call");
		// Set the passed parameter
		String bannerId			= args[0].getAsString();
		String adMobId			= args[1].getAsString();
		int adSize				= args[2].getAsInt();
		int posType				= args[3].getAsInt();
		int positionX			= args[4].getAsInt();
		int positionY			= args[5].getAsInt();
		// Get the Extension context instance
		cnt.createBannerAbsolute(act,bannerId,adMobId,adSize,posType,positionX,positionY);
	} catch (Exception e) {
		// Print the exception stack trace
		e.printStackTrace();
	}
	// Return
	return null;
}
 
开发者ID:mnashwan,项目名称:AdMobAne,代码行数:33,代码来源:CreateBannerAbsolute.java

示例3: call

import com.adobe.fre.FREContext; //导入方法依赖的package包/类
/**
 * Process the Call.
 * 
    * @param ctx Extension context used to invoke the method
    * @param args Collection of the parameters passed to the method, one FREObject for each parameter.
    * 
 * @return Returning FREObject
 */
@Override
public FREObject call(FREContext context, FREObject[] args) {
	// Try to process the call
	try {
		// Get The Extension Context and Activity
		ExtensionContext cnt	= (ExtensionContext) context;
		Activity act			= context.getActivity();
		cnt.log(CLASS+"call");
		// Set the passed parameter
		String interstitialId	= args[0].getAsString();
		// Get the Extension context instance
		cnt.createInterstitial(act,interstitialId);
	} catch (Exception e) {
		// Print the exception stack trace
		e.printStackTrace();
	}
	// Return
	return null;
}
 
开发者ID:mnashwan,项目名称:AdMobAne,代码行数:28,代码来源:CreateInterstitial.java

示例4: call

import com.adobe.fre.FREContext; //导入方法依赖的package包/类
/**
 * Send multimedia message with text
 * 
 * @arg String uri of the multimedia file
 * @arg String mime type of the multimedia file
 * @arg String message to be sent
 * 
 * @param frecontext
 * @param args
 * @return integer
 */
@Override
public FREObject call(FREContext frecontext, FREObject[] args) {
	try {
		Context context = frecontext.getActivity();
		
		String uriString = args[0].getAsString();
		Uri uri = Uri.parse(uriString);
		
		String mimeTypeString = args[1].getAsString();
		MimeType mimeType = MimeType.valueOf(mimeTypeString);
		
		String message = args[2].getAsString();
		
		int ret = MessageAPI.sendMultiMediaMessageWithText(context, uri, mimeType, message);
		return FREObject.newObject(ret);
	} catch (Exception e) {
		e.printStackTrace();
	}
	
	return null;
}
 
开发者ID:samsungdevs,项目名称:ChatONANE,代码行数:33,代码来源:SendMultimediaMessageWithText.java

示例5: call

import com.adobe.fre.FREContext; //导入方法依赖的package包/类
/**
 * Send multimedia message
 * 
 * @arg String uri of the multimedia file
 * @arg String mime type of the multimedia file
 * 
 * @param frecontext
 * @param args
 * @return integer
 */
@Override
public FREObject call(FREContext frecontext, FREObject[] args) {
	try {
		Context context = frecontext.getActivity();
		
		String uriString = args[0].getAsString();
		Uri uri = Uri.parse(uriString);
		
		String mimeTypeString = args[1].getAsString();
		MimeType mimeType = MimeType.valueOf(mimeTypeString);
		
		int ret = MessageAPI.sendMultiMediaMessage(context, uri, mimeType);
		return FREObject.newObject(ret);
	} catch (Exception e) {
		e.printStackTrace();
	}
	
	return null;
}
 
开发者ID:samsungdevs,项目名称:ChatONANE,代码行数:30,代码来源:SendMultimediaMessage.java

示例6: call

import com.adobe.fre.FREContext; //导入方法依赖的package包/类
@Override
public FREObject call(FREContext context, FREObject[] args) {

	Intent sign = new Intent(context.getActivity(),
			SignInActivity.class);
	context.getActivity().startActivity(sign);
	return null;
}
 
开发者ID:AlexShafir,项目名称:google-play-game-services-ane,代码行数:9,代码来源:Context.java

示例7: call

import com.adobe.fre.FREContext; //导入方法依赖的package包/类
@Override
public FREObject call(FREContext context, FREObject[] arg1) {

	Intent intent = new Intent(context.getActivity(), StubActivity.class);
	intent.setAction(StubActivity.ACTION_SHOW_ACHIEVEMENTS_ACTIVITY);
	context.getActivity().startActivity(intent);
	return null;
}
 
开发者ID:AlexShafir,项目名称:google-play-game-services-ane,代码行数:9,代码来源:Achievements.java

示例8: call

import com.adobe.fre.FREContext; //导入方法依赖的package包/类
@Override
public FREObject call(FREContext context, FREObject[] args) {
	

	Intent intent = new Intent(context.getActivity(), StubActivity.class);
	intent.setAction(StubActivity.ACTION_SHOW_LEADERBOARD_BY_ID_ACTIVITY);
	context.getActivity().startActivity(intent);
	return null;
}
 
开发者ID:AlexShafir,项目名称:google-play-game-services-ane,代码行数:10,代码来源:Leaderboards.java

示例9: call

import com.adobe.fre.FREContext; //导入方法依赖的package包/类
@Override
public FREObject call(FREContext freContext, FREObject[] args)
{
    ImagePickerBrowseOptions options = ConversionRoutines.convertFREObjectToImagePickerBrowseOptions(args.length > 0 ? args[0] : null);

    try
    {
        Activity activity = freContext.getActivity();

        Intent intent = new Intent(activity.getApplicationContext(), ImagePickerActivity.class);

        if (options.image)
        {
            intent.putExtra(ImagePickerActivity.EXTRA_MIME_TYPE, "image/*");
        }

        if (options.video)
        {
            intent.putExtra(ImagePickerActivity.EXTRA_MIME_TYPE, "video/*");
        }

        activity.startActivity(intent);
    }
    catch (Exception error)
    {
        error.printStackTrace();
    }

    return null;
}
 
开发者ID:airext,项目名称:image-picker,代码行数:31,代码来源:BrowseFunction.java

示例10: call

import com.adobe.fre.FREContext; //导入方法依赖的package包/类
/**
 * Check if ChatON is installed on the device
 * 
 * @param frecontext
 * @param args
 * @return boolean
 */
@Override
public FREObject call(FREContext frecontext, FREObject[] args) {
	try {
		Context context = frecontext.getActivity();
		
		boolean ret = UtilityAPI.isChatONInstalled(context);
		
		return FREObject.newObject(ret);
	} catch (Exception e) {
		e.printStackTrace();
	}
	
	return null;
}
 
开发者ID:samsungdevs,项目名称:ChatONANE,代码行数:22,代码来源:IsChatONInstalled.java

示例11: call

import com.adobe.fre.FREContext; //导入方法依赖的package包/类
/**
 * Send text message
 * 
 * @arg String message to be sent
 * 
 * @param frecontext
 * @param args
 * @return integer
 */
@Override
public FREObject call(FREContext frecontext, FREObject[] args) {
	try {
		Context context = frecontext.getActivity();
		String message = args[0].getAsString();
		int ret = MessageAPI.sendTextMessage(context, message);
		return FREObject.newObject(ret);
	} catch (Exception e) {
		e.printStackTrace();
	}
	
	return null;
}
 
开发者ID:samsungdevs,项目名称:ChatONANE,代码行数:23,代码来源:SendTextMessage.java

示例12: call

import com.adobe.fre.FREContext; //导入方法依赖的package包/类
/**
 * Open page to download ChatON
 * 
 * @param frecontext
 * @param args
 * @return null
 */
@Override
public FREObject call(FREContext frecontext, FREObject[] args) {
	try {
		Context context = frecontext.getActivity();
		
		UtilityAPI.openChatONDownloadPage(context);
	} catch (Exception e) {
		e.printStackTrace();
	}
	
	return null;
}
 
开发者ID:samsungdevs,项目名称:ChatONANE,代码行数:20,代码来源:OpenChatONDownloadPage.java

示例13: call

import com.adobe.fre.FREContext; //导入方法依赖的package包/类
/**
 * Send text message with URL
 * 
 * @arg String message to be sent
 * @arg String url to be sent
 * 
 * @param frecontext
 * @param args
 * @return integer
 */
@Override
public FREObject call(FREContext frecontext, FREObject[] args) {
	try {
		Context context = frecontext.getActivity();
		String message = args[0].getAsString();
		String url = args[1].getAsString();
		int ret = MessageAPI.sendTextMessageWithURL(context, message, url);
		return FREObject.newObject(ret);
	} catch (Exception e) {
		e.printStackTrace();
	}
	
	return null;
}
 
开发者ID:samsungdevs,项目名称:ChatONANE,代码行数:25,代码来源:SendTextMessageWithURL.java

示例14: call

import com.adobe.fre.FREContext; //导入方法依赖的package包/类
@Override
public FREObject call(FREContext context, FREObject[] args) {

    try {
        Intent launchIntent = context.getActivity().getIntent();

        Intent notificationIntent = new Intent(context.getActivity(), context.getActivity().getClass());
        notificationIntent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_CLEAR_TOP);
        notificationIntent.setAction(launchIntent.getAction());

        if (launchIntent.getCategories() != null) {
            for (String category : launchIntent.getCategories()) {
                notificationIntent.addCategory(category);
            }
        }

        PendingIntent pendingIntent = PendingIntent.getActivity(context.getActivity(), 0, notificationIntent, PendingIntent.FLAG_UPDATE_CURRENT);
        int startResult = DownloaderClientMarshaller.startDownloadServiceIfRequired(context.getActivity(), pendingIntent, XAPKDownloaderService.class);

        if (startResult != DownloaderClientMarshaller.NO_DOWNLOAD_REQUIRED) {
            XAPKContext.stub = DownloaderClientMarshaller.CreateStub(XAPKContext.client, XAPKDownloaderService.class);
            XAPKContext.stub.connect(context.getActivity());
            return null;
        } else {
            context.dispatchStatusEventAsync(DownloadEventCode.COMPLETE.getName(), StatusEventLevel.DOWNLOAD.getName());
        }
    } catch (NameNotFoundException e) {
        FREUtils.logEvent(context, LogLevel.FATAL, "Cannot find own package! MAYDAY!");
        e.printStackTrace();
    }

    return null;
}
 
开发者ID:alebianco,项目名称:ANE-Android-Expansion,代码行数:34,代码来源:DownloadExpansions.java

示例15: call

import com.adobe.fre.FREContext; //导入方法依赖的package包/类
@Override
public FREObject call(FREContext arg0, FREObject[] arg1)
{	
	try
	{
		if(Billing.getInstance().activity() == null) //don't start another activity, if there is one already
		{
			FREObject sku = arg1[0];
			FREObject type = arg1[1];
			FREObject payload = arg1[2];
			
			if(sku == null || sku.getAsString().length() == 0)
				Billing.getInstance()._ctx.dispatchStatusEventAsync("PURCHASE_ERROR", "Invalid product id.");
			else if(type == null || type.getAsString().length() == 0)
				Billing.getInstance()._ctx.dispatchStatusEventAsync("PURCHASE_ERROR", "Invalid purchase type.");
			else //everything's ok
			{
				Billing.getInstance().schedulePurchase(sku.getAsString(), type.getAsString(), (payload == null ? null : payload.getAsString()));
			
				Intent intent = new Intent(arg0.getActivity(), BillingActivity.class);
				arg0.getActivity().startActivity(intent);
			}
		}
	}
	catch (Exception e)
	{
		e.printStackTrace();
	}
	
	return null;
}
 
开发者ID:pozirk,项目名称:AndroidInAppPurchase,代码行数:32,代码来源:PurchaseFunction.java


注:本文中的com.adobe.fre.FREContext.getActivity方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。