Android Open Source - Broadsheet.ie-Android Base Fragment Activity






From Project

Back to project page Broadsheet.ie-Android.

License

The source code is released under:

Copyright (c) 2013 Karl Monaghan (http://karlmonaghan.com/) Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Soft...

If you think the Android project Broadsheet.ie-Android listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.

Java Source Code

package ie.broadsheet.app;
//from w  w  w .  j a v a2  s.c om
import ie.broadsheet.app.services.BroadsheetServices;
import android.app.AlertDialog;
import android.app.ProgressDialog;
import android.os.Bundle;

import com.actionbarsherlock.app.SherlockFragmentActivity;
import com.google.analytics.tracking.android.EasyTracker;
import com.octo.android.robospice.SpiceManager;

public class BaseFragmentActivity extends SherlockFragmentActivity {
    private ProgressDialog mProgressDialog;

    private SpiceManager spiceManager = new SpiceManager(BroadsheetServices.class);

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);

        mProgressDialog = new ProgressDialog(this);

        mProgressDialog.setIndeterminate(true);
        mProgressDialog.setProgressStyle(ProgressDialog.STYLE_SPINNER);

        EasyTracker.getInstance().setContext(this);

    }

    @Override
    protected void onStart() {
        spiceManager.start(this);
        super.onStart();

        EasyTracker.getInstance().activityStart(this);
    }

    @Override
    protected void onStop() {
        spiceManager.shouldStop();
        super.onStop();

        EasyTracker.getInstance().activityStop(this);
    }

    @Override
    protected void onPause() {
        mProgressDialog.dismiss();
        super.onPause();
    }

    public void onPreExecute(String message) {
        mProgressDialog.setMessage(message);
        mProgressDialog.show();
    }

    public void onPostExecute() {
        mProgressDialog.dismiss();
    }

    public SpiceManager getSpiceManager() {
        return spiceManager;
    }

    public void showError(String error) {
        AlertDialog.Builder builder = new AlertDialog.Builder(this);
        builder.setMessage(error).setPositiveButton(R.string.okay, null);

        builder.create().show();
    }
}




Java Source Code List

ie.broadsheet.app.BaseFragmentActivity.java
ie.broadsheet.app.BroadsheetApplication.java
ie.broadsheet.app.CommentListActivity.java
ie.broadsheet.app.PostDetailActivity.java
ie.broadsheet.app.PostListActivity.java
ie.broadsheet.app.adapters.CommentAdapter.java
ie.broadsheet.app.adapters.PostListAdapter.java
ie.broadsheet.app.adapters.PostListEndlessAdapter.java
ie.broadsheet.app.client.http.MultipartFormDataContent.java
ie.broadsheet.app.dialog.AboutDialog.java
ie.broadsheet.app.dialog.MakeCommentDialog.java
ie.broadsheet.app.dialog.TipDialog.java
ie.broadsheet.app.dialog.WebViewDialog.java
ie.broadsheet.app.fragments.PostDetailFragment.java
ie.broadsheet.app.fragments.PostListFragment.java
ie.broadsheet.app.model.json.AttachmentItem.java
ie.broadsheet.app.model.json.Attachments.java
ie.broadsheet.app.model.json.Author.java
ie.broadsheet.app.model.json.Category.java
ie.broadsheet.app.model.json.Comment.java
ie.broadsheet.app.model.json.Image.java
ie.broadsheet.app.model.json.PostList.java
ie.broadsheet.app.model.json.Post.java
ie.broadsheet.app.model.json.ResponseData.java
ie.broadsheet.app.model.json.SinglePost.java
ie.broadsheet.app.model.json.SubmitTipResponse.java
ie.broadsheet.app.model.json.Tag.java
ie.broadsheet.app.requests.DownloadFileRequest.java
ie.broadsheet.app.requests.MakeCommentRequest.java
ie.broadsheet.app.requests.PostListRequest.java
ie.broadsheet.app.requests.PostRequest.java
ie.broadsheet.app.requests.SubmitTipRequest.java
ie.broadsheet.app.services.BroadsheetServices.java