Skip to content

Commit

Permalink
Merge pull request #1190 from monomon/develop
Browse files Browse the repository at this point in the history
Update Android host to work with new sdk
  • Loading branch information
seclorum authored Jul 20, 2017
2 parents 407a20b + c264992 commit d41d50d
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 6 deletions.
4 changes: 2 additions & 2 deletions src/moai-android/java/src/com/moaisdk/core/MoaiActivity.java
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,8 @@
// Moai
import com.moaisdk.core.*;

import org.apache.http.client.methods.HttpGet;
import org.apache.http.impl.client.DefaultHttpClient;
import java.net.URLConnection;
import java.net.HttpURLConnection;
import java.net.URI;
import android.os.AsyncTask;
import android.net.Uri;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,10 +75,16 @@ static void handleMessage ( Context context, Intent intent ) {

PendingIntent contentIntent = PendingIntent.getActivity ( context, 0, notifyIntent, PendingIntent.FLAG_UPDATE_CURRENT );

NotificationManager notificationManager = ( NotificationManager ) context.getSystemService ( Context.NOTIFICATION_SERVICE );
Notification notification = new Notification ( icon, message, System.currentTimeMillis ());
notification.setLatestEventInfo ( context, title, message, contentIntent );
notification.flags |= Notification.FLAG_AUTO_CANCEL;
NotificationManager notificationManager = ( NotificationManager ) context.getSystemService ( Context.NOTIFICATION_SERVICE );
// Notification notification = new Notification ( icon, message, System.currentTimeMillis ());
Notification.Builder notificationBuilder = new Notification.Builder(context);
notificationBuilder.setSmallIcon(icon);
notificationBuilder.setContentTitle(title);
notificationBuilder.setContentText(message);
notificationBuilder.setContentIntent(contentIntent);
notificationBuilder.setAutoCancel(true);

Notification notification = notificationBuilder.build();

String tag = intent.getStringExtra ( "collapse_key" );
int id = ( intent.getStringExtra ( "id" ) != null ) ? Integer.parseInt ( intent.getStringExtra ( "id" )) : 1;
Expand Down

0 comments on commit d41d50d

Please sign in to comment.