Java 类com.parse.PushService 实例源码

项目:Nefete    文件:NefeteApp.java   
@Override public void onCreate() {
  super.onCreate();

  Parse.initialize(this, "aTAL8FkWWQRG2bsilzCzwQpVMY2YCK8skFryZIFa", "vLefUWhxBk12E8X4oighFYt25iGnMYRTUP58RDJg");
  ParseFacebookUtils.initialize(getString(R.string.app_id));
  PushService.setDefaultPushCallback(this, ViewActivity.class);
  ParseInstallation.getCurrentInstallation().saveInBackground();

  if (BuildConfig.DEBUG) {
    Timber.plant(new DebugTree());
  } else {
    // TODO Crashlytics.start(this);
    // TODO Timber.plant(new CrashlyticsTree());
  }

  applicationGraph = ObjectGraph.create(getModules().toArray());
}
项目:wallet    文件:WalletApplication.java   
@Override
public void onCreate() {
  super.onCreate();

  // Add your initialization code here
  Parse.initialize(this, getString(R.string.parse_app_id),
      getString(R.string.parse_client_key));

  ParseACL defaultACL = new ParseACL();

  // If you would like all objects to be private by default, remove this line.
  defaultACL.setPublicReadAccess(true);

  ParseACL.setDefaultACL(defaultACL, true);

  // Specify a Activity to handle all pushes by default.
  PushService.setDefaultPushCallback(this, MainActivity.class);

  // Save the current installation.
  ParseInstallation.getCurrentInstallation().saveInBackground();  
}
项目:stepout    文件:CreateEventActivity.java   
@Subscribe
public void savedEvent(Event event) {

    Util.dismissLoadingDialog();

    if (event.getHash() == null) {
        Toast.makeText(getApplicationContext(), getResources().getString(R.string.some_error), Toast.LENGTH_LONG).show();
    } else {
        Toast.makeText(getApplicationContext(), getResources().getString(R.string.event_saved), Toast.LENGTH_LONG).show();

        DataExchange.uploadedEvents.add(event);

        Intent intent = new Intent(this, ViewEventAsAuthorActivity.class);
        intent.putExtra(DataExchange.EVENT_HASH_FOR_VIEW_EVENT_ACTIVITY_KEY, event.getHash());
        PushService.subscribe(getApplicationContext(), DataExchange.PREFIX_FOR_CHANNEL_NAME + event.getHash(), MainActivity.class);
        startActivity(intent);
    }
}
项目:stepout    文件:ViewEventAsRespondentActivity.java   
@Subscribe
public void getUnresponseStatus(String status) {
    Util.dismissLoadingDialog();
    if (status.equals(DataExchange.STATUS_SUCCESS)) {
        Toast.makeText(getApplicationContext(), getResources().getString(R.string.you_unrespond), Toast.LENGTH_LONG).show();

        PushService.unsubscribe(getApplicationContext(), DataExchange.PREFIX_FOR_CHANNEL_NAME + currentEvent.getHash());
        ParsePush push = new ParsePush();
        ParseQuery pushQuery = ParseInstallation.getQuery();
        pushQuery.whereNotEqualTo("installationId", ParseInstallation.getCurrentInstallation().getInstallationId());
        pushQuery.whereEqualTo("channels", DataExchange.PREFIX_FOR_CHANNEL_NAME + currentEvent.getHash());
        push.setQuery(pushQuery);
        try {
            JSONObject data = new JSONObject("{\"action\": \"com.stepout.main.CustomReceiver.SHOW_EVENT\", \"message\": \"" + getString(R.string.user_do_not_attend_event, currentEvent.getRespondentsHash().size()) + "\", \"" + DataExchange.EVENT_HASH_FOR_VIEW_EVENT_ACTIVITY_KEY + "\": \"" + currentEvent.getHash() + "\", \"author\": \"" + currentEvent.getAuthorHash() + "\"}");
            push.setData(data);
        } catch (JSONException e) {
            e.printStackTrace();
        }
        push.sendInBackground();
        Intent intentDeletion = new Intent(this, MapsActivity.class);
        startActivity(intentDeletion);
    } else if (status.equals(DataExchange.STATUS_FAIL)) {
        Toast.makeText(getApplicationContext(), getResources().getString(R.string.some_error), Toast.LENGTH_LONG).show();
    }
}
项目:stepout    文件:ViewEventAsAuthorActivity.java   
@Subscribe
public void removeEventStatus(String status) {

    Util.dismissLoadingDialog();

    if (status.equals(DataExchange.STATUS_REMOVE_SUCCESS)) {
        Toast.makeText(getApplicationContext(), getResources().getString(R.string.remove_success), Toast.LENGTH_LONG).show();

        PushService.unsubscribe(getApplicationContext(), DataExchange.PREFIX_FOR_CHANNEL_NAME + currentEvent.getHash());
        ParsePush push = new ParsePush();
        ParseQuery pushQuery = ParseInstallation.getQuery();
        pushQuery.whereNotEqualTo("installationId", ParseInstallation.getCurrentInstallation().getInstallationId());
        pushQuery.whereEqualTo("channels", DataExchange.PREFIX_FOR_CHANNEL_NAME + currentEvent.getHash());
        push.setQuery(pushQuery);
        push.setMessage(getString(R.string.author_deleted_event, android.text.format.DateFormat.format("dd.MM.yy hh:mm", currentEvent.getDate())));
        push.sendInBackground();

        Intent intent = new Intent(this, MapsActivity.class);
        intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP | Intent.FLAG_ACTIVITY_NEW_TASK);
        startActivity(intent);
    } else if (status.equals(DataExchange.STATUS_REMOVE_FAIL)) {
        isRemovingProcess = false;
        Toast.makeText(getApplicationContext(), getResources().getString(R.string.some_error), Toast.LENGTH_LONG).show();
    }
}
项目:CS492-FA13    文件:ParseApplication.java   
@Override
public void onCreate() {
    super.onCreate();

    // Add your initialization code here
    Parse.initialize(this, "0805cw8bWmLdhkfsYyx6qw3j6mAueM6kw3fJAqmX", "W0UgYdjieM8SkJWGAMqD8LBo62XB04Ajh8F0W0As");

    //push code, wants the application and the activity to display when selected
    PushService.setDefaultPushCallback(this, Buttons.class);
    ParseInstallation.getCurrentInstallation().saveInBackground();

    //enables anonymous users if no user is signed in
    ParseUser.enableAutomaticUser();
    ParseACL defaultACL = new ParseACL();

    // If you would like all objects to be private by default, remove this line.
    defaultACL.setPublicReadAccess(true);

    ParseACL.setDefaultACL(defaultACL, true);
}
项目:AmazingFriends    文件:AmazingFriendsApplication.java   
@Override
public void onCreate() { 
    super.onCreate();

    Parse.initialize(this, "PsOttCLwKheePLzmK04aQKCuPvDPoVp1jticfIzj", "lRI1N7DNqhLIGxkx1B2hkpLKg67B5a7U0fbXS9qQ");


    //PushService.setDefaultPushCallback(this, MainActivity.class);
    PushService.setDefaultPushCallback(this, MainActivity.class, 
            R.drawable.ic_stat_ic_launcher);
    ParseInstallation.getCurrentInstallation().saveInBackground();
}
项目:sophia    文件:Application.java   
@Override
 public void onCreate() {
   super.onCreate();

// Initialize the Parse SDK.
Parse.initialize(this, "YOUR_APP_ID", "YOUR_CLIENT_KEY"); 

// Specify an Activity to handle all pushes by default.
PushService.setDefaultPushCallback(this, MainActivity.class);
 }
项目:Fitness-Buddy-Group-Project    文件:StrengthCoachApplication.java   
@Override
public void onCreate() {
    super.onCreate();
    // Register your parse models here
    ParseObject.registerSubclass(Address.class);
    ParseObject.registerSubclass(Gym.class);
    ParseObject.registerSubclass(Message.class);
    ParseObject.registerSubclass(SimpleUser.class);
    ParseObject.registerSubclass(Trainer.class);
    ParseObject.registerSubclass(Review.class);
    ParseObject.registerSubclass(TrainerSlots.class);
    ParseObject.registerSubclass(BlockedSlots.class);
    Parse.enableLocalDatastore(this);
    Parse.initialize(this, APPLICATION_ID, CLIENT_KEY);

    ParsePush.subscribeInBackground("", new SaveCallback() {
        @Override
        public void done(ParseException e) {
            if (e == null) {
                Log.d("com.parse.push", "successfully subscribed to the broadcast channel.");
                PushService.setDefaultPushCallback(getBaseContext(), ChatActivity.class);//change the class where u want to go after clicking on noti
                ParseInstallation.getCurrentInstallation().saveInBackground();
            } else {
                Log.e("com.parse.push", "failed to subscribe for push", e);
            }
        }
    });



    FacebookSdk.sdkInitialize(getApplicationContext());
}
项目:class_board_app    文件:ParseApplication.java   
@Override
public void onCreate() {
    super.onCreate();
    ParseObject.registerSubclass(Post.class);
    // Add your initialization code here
     Parse.initialize(this, "9p1jgEiWtixYQzIYbrh3oiY2rA9aNuCnOQYOhQ4i", "UETquOw1dDTAD0uUQ3jpf8iW9uVLQ5fGfddkFgdK");

 PushService.setDefaultPushCallback(this,PostListActivity.class);

}
项目:ParseNotificationExample    文件:ParseApplication.java   
@Override
public void onCreate() {
    super.onCreate();
    Parse.initialize(this, Keys.applicationId, Keys.clientKey);
    PushService.setDefaultPushCallback(this, MainActivity.class);
    ParseInstallation.getCurrentInstallation().saveInBackground();
}
项目:cat-chat-android    文件:CatChatApplication.java   
@Override
public void onCreate() {
    super.onCreate();

    Parse.initialize(this, getString(R.string.parse_app_id), getString(R.string.parse_client_key));

    PushService.setDefaultPushCallback(this, InboxActivity.class);
    ParseFacebookUtils.initialize(getString(R.string.fb_app_id));
}
项目:CloudyPhone    文件:PushManager.java   
/**
 * Subscribe to push service with the channel is current user id
 * 
 * @param context
 * @throws Exception
 *             if user was not logged in
 */
public static void subscribe(Context context) throws Exception {
    // Since we don't launch activity when receive push notification
    // Activity can be set to whatever activity
    // PushService.subscribe(context, getChannel(context),
    // CloudyPhoneActivity.class);

    // TODO test only
    PushService.subscribe(context, "huy", CloudyPhoneActivity.class);
}
项目:CloudyPhone    文件:PushManager.java   
/**
 * Unsubscribe to push service
 * 
 * @throws Exception
 *             if user was not logged in
 */
public static void unsubscribe(Context context) throws Exception {
    // PushService.unsubscribe(context, getChannel(context));

    // TODO test only
    PushService.unsubscribe(context, "huy");
}
项目:android-ribbit-design    文件:RibbitApplication.java   
@Override
public void onCreate() { 
    super.onCreate();
    Parse.initialize(this, 
        "5W9RXHhz1FYThSlwE5I7OPwBzCDkQEHUDog0MAR7", 
        "8MvV9aqRhMPJgN1zMIT1PHdst9HylXznJnWKRIwL");

    //PushService.setDefaultPushCallback(this, MainActivity.class);
    PushService.setDefaultPushCallback(this, MainActivity.class, 
            R.drawable.ic_stat_ic_launcher);
    ParseInstallation.getCurrentInstallation().saveInBackground();
}
项目:BurnMessenger    文件:BurnMessengerApplication.java   
@Override
public void onCreate() {
    super.onCreate();
    // make sure to change the "#..#" with the actualy keys obtained from Parse.com after registration!
    Parse.initialize(this, "####################################", "#####################################");
       PushService.setDefaultPushCallback(this, MainActivity.class, R.drawable.ic_stat_ic_launcher);
       ParseInstallation.getCurrentInstallation().saveInBackground();
}
项目:ShopAfter    文件:ShopAfterApp.java   
@Override public void onCreate() {
  super.onCreate();

  Parse.initialize(this, "ZT4hK5Z1U58TSxg2g5OjFjvX6tZiByYRVNRfLN5t", "Gx49K57B1FkE3BtjEPP2lrX47oL0ZrTdT5iltrRm");
  ParseFacebookUtils.initialize(getString(R.string.app_id));
  PushService.setDefaultPushCallback(this, ViewActivity.class);
  ParseInstallation.getCurrentInstallation().saveInBackground();

  if (BuildConfig.DEBUG) {
    Timber.plant(new DebugTree());
  } else {
    // TODO Crashlytics.start(this);
    // TODO Timber.plant(new CrashlyticsTree());
  }

  applicationGraph = ObjectGraph.create(getModules().toArray());
}
项目:MentorMe    文件:MentorMeApp.java   
private void initializeParse(){
    ParseObject.registerSubclass(User.class);
    ParseObject.registerSubclass(Request.class);
    ParseObject.registerSubclass(Rating.class);
    ParseObject.registerSubclass(Message.class);
    Parse.initialize(this, Constants.PARSE_APPLICATION_ID, Constants.PARSE_CLIENT_KEY);

    PushService.setDefaultPushCallback(this, MentorListActivity.class);
    ParseFacebookUtils.initialize(Constants.FACEBOOK_APP_ID);

    ParseACL defaultACL = new ParseACL();
    defaultACL.setPublicReadAccess(true);
    ParseACL.setDefaultACL(defaultACL, true);
}
项目:Jahamanga    文件:GlobalApplication.java   
@Override
public void onCreate() {
    // TODO Auto-generated method stub
    super.onCreate();
    mContext = this;
    client = new OkHttpClient();
    Glide.get(this).register(GlideUrl.class, InputStream.class, new OkHttpUrlLoader.Factory(client) );
    PushService.setDefaultPushCallback(this, MainActivity.class);
}
项目:EatingClub    文件:EatingClub.java   
@Override
public void onCreate() {
    super.onCreate();

    // Add your initialization code here
    Parse.initialize(this, "H71CQB2s5TvKZkUYPAvlnAOUFg953qcY8ipvcOpA",
            "gnzyfpH0w5mFsBOeReXXR4ZmKYw0UrsFfvbUFqJZ");
    // Also, specify a default Activity to handle push notifications in this
    // method as well
    PushService.setDefaultPushCallback(this, InitialPage.class);

    ParseUser.enableAutomaticUser();
    ParseACL defaultACL = new ParseACL();

    // If you would like all objects to be private by default, remove this
    // line.
    defaultACL.setPublicReadAccess(true);

    ParseACL.setDefaultACL(defaultACL, true);

    // Save the current Installation to Parse.
    ParseInstallation.getCurrentInstallation().saveInBackground();

    ParsePush.subscribeInBackground("", new SaveCallback() {
        @Override
        public void done(ParseException e) {
            if (e == null) {
                Log.d("com.parse.push",
                        "successfully subscribed to the broadcast channel.");
            } else {
                Log.e("com.parse.push", "failed to subscribe for push", e);
            }
        }
    });
}
项目:listsketcher    文件:ListSketcher.java   
@Override
public void onCreate() {
    super.onCreate();
    // The following line triggers the initialization of ACRA
    ACRA.init(this);
    Parse.initialize(this, "76aRATozBDlVtquGgSIRWSAnVu0XvvrkR6nYRxTK", "nnEzzujYBe1cg7ioSvdj81paev9zBDGuK5QGs6kA");
    PushService.setDefaultPushCallback(this, MainActivity.class);
    ParseInstallation.getCurrentInstallation().saveInBackground();
}
项目:stepout    文件:DataExchange.java   
public void onCreate() {
    super.onCreate();
    Parse.initialize(getApplicationContext(), "w8w75nqgzFroCnZEqO6auY85PJnTRKILNXYZUeKa", "UNH39pBxBzLAD4ekMZQUp0VzGUACPTPTHBT5x8qg");

    bus = new Bus();
    context = getApplicationContext();
    PushService.setDefaultPushCallback(getApplicationContext(), MainActivity.class);
}
项目:AndroidClient    文件:MAFApplication.java   
@Override
public void onCreate() {
    super.onCreate();
    // TODO: support portrait and landscape.

    // Register default font
    CalligraphyConfig.initDefault("fonts/OpenSans-Regular.ttf", R.attr.fontPath);

    // Register the parse models
    ParseObject.registerSubclass(User.class);
    ParseObject.registerSubclass(Transaction.class);
    ParseObject.registerSubclass(Goal.class);
    ParseObject.registerSubclass(Category.class);
    ParseObject.registerSubclass(Post.class);
    ParseObject.registerSubclass(Comment.class);

    // Enable local datastore
    Parse.enableLocalDatastore(this);

    // Initializing Parse
    Parse.initialize(this, getString(R.string.parseApplicationId),
            getString(R.string.parseClientId));
    Parse.setLogLevel(Parse.LOG_LEVEL_VERBOSE);
    PushService.setDefaultPushCallback(this, MainActivity.class);
    ParseInstallation.getCurrentInstallation().saveInBackground();

    // Pin Categories locally
    new CategoryDao().pin();
}
项目:FaceTag-Android    文件:PrsApplication.java   
@Override
public void onCreate() {
    super.onCreate();

    //Register Parse
    ParseObject.registerSubclass(PhotoTag.class);
    ParseObject.registerSubclass(Game.class);

    /*
     * Fill in this section with your Parse credentials
     */
    Parse.initialize(this, "97s1dXeGVg72YmhWjZVFXQvWFILwyyV78pftvQBe",
            "isrQzRX1HkVQyuqnab3m8DGEIWWcpKAt2iJ0CtFu");
    ParseFacebookUtils.initialize("551206871642297");
    PushService.setDefaultPushCallback(this, GameScreenActivity.class);
    ParseInstallation.getCurrentInstallation().saveInBackground();

    /*
     * For more information on app security and Parse ACL:
     * https://www.parse.com/docs/android_guide#security-recommendations
     */
    /*
     * ParseACL defaultACL = new ParseACL();
     * 
     * defaultACL.setPublicReadAccess(true);
     * 
     * ParseACL.setDefaultACL(defaultACL, true);
     */

    // Create global configuration and initialize ImageLoader with this
    // configuration
    DisplayImageOptions defaultOptions = new DisplayImageOptions.Builder()
            .cacheInMemory(true).cacheOnDisc(true).build();

    ImageLoaderConfiguration config = new ImageLoaderConfiguration.Builder(
            getApplicationContext()).defaultDisplayImageOptions(
            defaultOptions).build();

    ImageLoader.getInstance().init(config);
}
项目:ParseNotificationExample    文件:ParseApplication.java   
@Override
public void onCreate() {
    super.onCreate();
    Parse.initialize(this, Keys.applicationId, Keys.clientKey);
    PushService.setDefaultPushCallback(this, MainActivity.class);
    ParseInstallation.getCurrentInstallation().saveInBackground();
}
项目:BattlehackBarcelonaWedList    文件:WedListApplication.java   
@Override
public void onCreate() {
    super.onCreate();

    Log.v("PARSE", "initializing ");
    Parse.initialize(this, "DH2cziL69zkg0x3QvDpPFkYvwsBtJXyUBWRRqAzT", "PwjyxjWlIwdNnvJylWG3KYtsAWJijqWrNzlvFsvI");
       /* ParseObject testObject = new ParseObject("TestObject");
        testObject.put("foo", "bar");
        testObject.saveInBackground();
        */
    PushService.setDefaultPushCallback(this, FirstActivity.class);
    ParseInstallation.getCurrentInstallation().saveInBackground();
}
项目:effective_android_sample    文件:MainActivity.java   
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_main);

    // Parseを初期化(キーは変えてください)
    Parse.initialize(this, "x9IstpeOC5Ly7BKiJloLo4B4BohvzF2bkJryoZbL", "UD6kKn6YKxHPoi7QStg1i3qFFEzFUieSgSNPxTKm");
    // プッシュ通知から起動したいActivityを指定
    PushService.setDefaultPushCallback(this, MainActivity.class);
    ParseInstallation.getCurrentInstallation().saveInBackground();
    // プッシュ通知からの起動率を見たい場合は以下も追加
    ParseAnalytics.trackAppOpened(getIntent());
}
项目:icareyou    文件:FoodApplication.java   
@Override
public void onCreate() {
    super.onCreate();
    Parse.initialize(this, "kzy5un2baEqBMPR2hw86uWCOENBjpx2ctI0TArNr", "Vw3mRnTal3elRAiSBoSfCeupDeFgFNYFC8U5u2cq");
    PushService.setDefaultPushCallback(this, SplashActivity.class);

    init();
}
项目:sophia    文件:ParsePushApplication.java   
@Override
public void onCreate(){
    Parse.initialize(this, getString(R.string.parseAppID), getString(R.string.parseClientID));
    PushService.setDefaultPushCallback(this, MainActivity.class);
}
项目:Anypic-Android    文件:AnypicApplication.java   
@Override
public void onCreate() {
    super.onCreate();       

    /*
     * In this tutorial, we'll subclass ParseObjects for convenience to
     * create and modify Photo objects.
     * 
     * Also, we'll use an Activity class to keep track of the relationships
     * of ParseUsers with each other and Photos. Every time a user follows, likes 
     * or comments, a new activity is created to represent the relationship.
     */
    ParseObject.registerSubclass(Photo.class);
    ParseObject.registerSubclass(Activity.class);

    /*
     * Fill in this section with your Parse credentials
     */
    Parse.initialize(this, "ULUhsGj4IEJFeeeDWvDsFxQwRep54f4o4hubS91T", "YwiYyupJr7BMARWobwyHcUGYvAGOHBClhbveEicx");

    // Set your Facebook App Id in strings.xml
    ParseFacebookUtils.initialize(getString(R.string.app_id));


    /*
     * For more information on app security and Parse ACL:
     * https://www.parse.com/docs/android_guide#security-recommendations
     */
    ParseACL defaultACL = new ParseACL();

    /*
     * If you would like all objects to be private by default, remove this
     * line
     */
    defaultACL.setPublicReadAccess(true);

    /*
     * Default ACL is public read access, and user read/write access
     */
    ParseACL.setDefaultACL(defaultACL, true);

    /*
     *  Register for push notifications.
     */
    PushService.setDefaultPushCallback(this, LoginActivity.class);
    ParseInstallation.getCurrentInstallation().saveInBackground();
}
项目:SUREwalk_android    文件:MainApplication.java   
@Override
public void onCreate(){
    new ParseHandler(this).initializeParse();
    PushService.setDefaultPushCallback(this, MainActivity.class);
    ParseInstallation.getCurrentInstallation().saveInBackground();
}
项目:WatsiAndroidApp    文件:WatsiApplication.java   
private void configurePush() {
    // Specify an Activity to handle all pushes by default.
    PushService.subscribe(this, "NewsFeed", WatsiMainActivity.class);  
}
项目:Oy    文件:OyApplication.java   
@Override
public void onCreate() {
       Parse.initialize(this, "YOUR_APP_ID", "YOUR_CLIENT_KEY");
       PushService.setDefaultPushCallback(this, MainActivity.class);
       running = true;
}
项目:ChitChat    文件:ChatsActivity.java   
@Override
protected void onCreate(Bundle savedInstanceState) {
    requestWindowFeature(Window.FEATURE_INDETERMINATE_PROGRESS);
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_chats);
    ParseAnalytics.trackAppOpened(getIntent());
    final ActionBar ab = getActionBar();
    Resources r=getResources();
    //Drawable d=r.getColor(R.color.orange_800);
    ab.setBackgroundDrawable(new ColorDrawable(Color.parseColor("#ef6c00")));
    ab.setDisplayShowTitleEnabled(false);
    ab.setDisplayShowTitleEnabled(true);
    ab.setDisplayUseLogoEnabled(false);
    PushService.setDefaultPushCallback(this, ChatsActivity.class,R.drawable.ic_stat_ic_launcher_web);
    Typeface ironman = Typeface.createFromAsset(getAssets(),
            "actionman.ttf");
    int titleId = getResources().getIdentifier("action_bar_title", "id",
            "android");
    TextView yourTextView = (TextView) findViewById(titleId);
    Fab fab = (Fab) findViewById(R.id.fabbutton);
    fab.setFabColor(Color.parseColor("#ef6c00"));
    fab.setFabDrawable(getResources().getDrawable(
            R.drawable.create));
    fab.showFab();
    final Level data[] = new Level[] {
            //new Level("Text", R.drawable.ic_action_chat_orange),
            new Level("Picture", R.drawable.ic_action_picture_orange),
            new Level("Video", R.drawable.ic_action_video_orange), };
    fab.setOnClickListener(new OnClickListener() {

        @Override
        public void onClick(View v) {
            // TODO Auto-generated method stub
            LayoutInflater inflater = LayoutInflater
                    .from(getApplicationContext());
            View customTitle = inflater
                    .inflate(R.layout.dialog_title, null);
            AlertDialog.Builder builder = new AlertDialog.Builder(
                    ChatsActivity.this).setTitle(R.string.share_option)
                    .setAdapter(
                            new LevelAdapter(ChatsActivity.this,
                                    R.layout.dialog_list_item, data),
                            mDialogListener);

            AlertDialog dialog = builder.create();
            dialog.setCustomTitle(customTitle);
            dialog.getWindow().getAttributes().windowAnimations = R.style.dialog_animation;
            builder.show();

        }
    });
    //yourTextView.setTypeface(ironman);
    ab.setNavigationMode(ActionBar.NAVIGATION_MODE_TABS);
    mSectionsPagerAdapter = new SectionsPagerAdapter(
            getSupportFragmentManager());

    // Set up the ViewPager with the sections adapter.
    mViewPager = (ViewPager) findViewById(R.id.mpager);
    mViewPager.setAdapter(mSectionsPagerAdapter);
    ParseUser currentUser = ParseUser.getCurrentUser();
    if (currentUser == null) {
        navigateToLogin();
    }
    mViewPager
            .setOnPageChangeListener(new ViewPager.SimpleOnPageChangeListener() {
                @Override
                public void onPageSelected(int position) {
                    ab.setSelectedNavigationItem(position);
                }
            });

    // For each of the sections in the app, add a tab to the action bar.
    for (int i = 0; i < mSectionsPagerAdapter.getCount(); i++) {
        // Create a tab with text corresponding to the page title defined by
        // the adapter. Also specify this Activity object, which implements
        // the TabListener interface, as the callback (listener) for when
        // this tab is selected.
        ab.addTab(ab.newTab().setText(mSectionsPagerAdapter.getPageTitle(i))
                .setTabListener(this));
    }
}
项目:schoolapp    文件:Application.java   
@Override
public void onCreate() {
  super.onCreate();
 Parse.initialize(this, "", "");
 PushService.setDefaultPushCallback(this, aloogle.rebuapp.activity.SplashScreen.class);
}
项目:LangMe    文件:ParseApplication.java   
@Override
public void onCreate() {
    super.onCreate();

    // Add your initialization code here
      Parse.initialize(this, "BHZ96s2YvmANgiw5hXXYeqrVX4nf9RYiG9j71lE1", "jXIblFviyGREPASI3bu6jZNcT92n1KCDzUv7kSiz");



      PushService.setDefaultPushCallback(this ,  Pram.class );

    ParseUser.enableAutomaticUser();
    ParseACL defaultACL = new ParseACL();


    defaultACL.setPublicReadAccess(true);

    ParseACL.setDefaultACL(defaultACL, true);
}