Activity getApplication - top ranked examples from Open Source projects

These code examples were ranked by Codota’s semantic indexing as the best open source examples for Activity getApplication method.

This code example shows how to use the following methods:getApplication, startActivity
		if ( sMovie != null ) {
			 
			sMovie.finish ();
		} 
	 
		Intent movie = new Intent ( sActivity.getApplication (), MoaiMoviePlayer.class );
		movie.putExtra ( "url", url );
		sActivity.startActivity ( movie );
	} 
 
	//----------------------------------------------------------------// 
	public static void play () { 
		 
		if ( sMovie != null ) {
			 
			sMovie.startPlayback ();
		} 
	} 
	 
	//----------------------------------------------------------------// 
6
CodeRank
Experience pair programming with AI  Get Codota for Java
This code example shows how to use the following methods:getApplication
	} 
 
	@Override 
	public void onClick(View v) {
        Activity activity = (Activity)v.getContext();
        SheJiaoMaoApplication sheJiaoMao = (SheJiaoMaoApplication)activity.getApplication();
        LocalAccount currentAccount = sheJiaoMao.getCurrentAccount();
        User user = (User) currentAccount.getUser();
        if (user != null) {
        	QueryUserTask queryUserTask = new QueryUserTask(activity, user, changeListener);
        	queryUserTask.execute();
        } 
	} 
 
} 
7
CodeRank
Experience pair programming with AI  Get Codota for Java
This code example shows how to use the following methods:getApplication
		return null; 
	} 
 
	public TwidereApplication getApplication() { 
		final Activity activity = getActivity();
		if (activity != null) return (TwidereApplication) activity.getApplication();
		return null; 
	} 
 
	public ContentResolver getContentResolver() {
		final Activity activity = getActivity();
		if (activity != null) return activity.getContentResolver();
		return null; 
	} 
 
	public SharedPreferences getSharedPreferences(final String name, final int mode) {
		final Activity activity = getActivity();
		if (activity != null) return activity.getSharedPreferences(name, mode);
		return null; 
	} 
6
CodeRank
Experience pair programming with AI  Get Codota for Java
This code example shows how to use the following methods:getApplication, getLayoutInflater
	 * Статус дефектов для отображения. 
	 */ 
	private Status status;
 
	public HoleAdapter(Activity activity, Status status) {
		rosyama = (Rosyama) activity.getApplication();
		layoutInflater = activity.getLayoutInflater();
		this.status = status;
	} 
 
	/** 
	 * Изменяет статус дефектов для отображения. 
	 *  
	 * @param status 
	 */ 
	public void setStatus(Status status) {
		this.status = status;
		notifyDataSetChanged();
	} 
 
6
CodeRank
Experience pair programming with AI  Get Codota for Java
This code example shows how to use the following methods:getApplication
		return null; 
	} 
 
	public TwidereApplication getApplication() { 
		final Activity activity = getActivity();
		if (activity != null) return (TwidereApplication) activity.getApplication();
		return null; 
	} 
 
	public ContentResolver getContentResolver() {
		final Activity activity = getActivity();
		if (activity != null) return activity.getContentResolver();
		return null; 
	} 
 
	public MultiSelectManager getMultiSelectManager() { 
		return getApplication() != null ? getApplication().getMultiSelectManager() : null; 
	} 
 
	public SharedPreferences getSharedPreferences(final String name, final int mode) {
6
CodeRank
Experience pair programming with AI  Get Codota for Java
This code example shows how to use the following methods:getApplication
	Picture picture = (Picture) urls[3];
	Bitmap downloadImage = null;
	// make sure the user is watching the picture 
	if (originalPosition == gallery.getSelectedItemPosition()) {
	    try { 
		File imageFileOnExternalDirectory = FileUtils.getInstance().getFileFromGallery(activity,
			picture.getFileName(), picture.getForceExtension(), fileUrl, true,
			((RegalAndroidApplication) activity.getApplication()).getCurrentAlbum().getName());
		downloadImage = BitmapFactory.decodeFile(imageFileOnExternalDirectory.getPath());
		picture.setResizedImageCachePath(imageFileOnExternalDirectory.getPath());
 
	    } catch (GalleryConnectionException e) {
		logger.debug(e.getMessage());
	    } catch (FileHandlingException e) {
		logger.debug(e.getMessage());
	    } 
	} 
	return downloadImage;
    } 
 
6
CodeRank
Experience pair programming with AI  Get Codota for Java
This code example shows how to use the following methods:getApplication
     */ 
    EateriesLookupTask(final ListActivity listActivity, final Retriever retriever, final Comparator<Eatery> comparator) {
        this.listActivity = listActivity;
        this.retriever = retriever;
        this.comparator = comparator;
        application = (MittagstischApplication) listActivity.getApplication();
    } 
 
    /** {@inheritDoc} */ 
    @Override 
    protected void onPostExecute(final List<Eatery> eateries) {
        Collections.sort(eateries, comparator);
        listActivity.setListAdapter(new EateryAdapter(eateries));
    } 
 
    /** {@inheritDoc} */ 
    @Override 
    protected List<Eatery> doInBackground(Void... arg0) {
        if (application.hasEateries()) {
            return application.getEateries();
4
CodeRank
Experience pair programming with AI  Get Codota for Java

Related Activity getApplication Questions & Answers:

getApplication Method Overview
Return the application that owns this activity.
See Code Examples for other Android Activity Methods: