Ejemplo n.º 1
0
        /// <summary>
        /// @brief Starts the activity in the sapa environment
        ///
        /// Setup intent by adding custom class loader and extras edit_mode
        /// TODO: Description on what's the edit_mode
        /// </summary>
        /// <param name="mode"> </param>
        private bool startSapaActivity(string instanceId, int mode)
        {
            Context context = Context;

            Log.d(TAG, "Start sapa app");
            Log.d(TAG, "instanceId:" + instanceId);
            if (null == context)
            {
                Log.w(TAG, "Cannot start activity for instance " + instanceId + ": null context");
                return(false);
            }

            if (null == mSapaServiceConnector)
            {
                Log.w(TAG, "Cannot start activity for instance " + instanceId + ": service connector not set to the FC context");
                return(false);
            }

            Intent intent = mSapaServiceConnector.getLaunchIntent(instanceId);

            if (null == intent)
            {
                Log.w(TAG, "Cannot start activity for instance " + instanceId + ": launch intent is null");
                return(false);
            }

            intent.ExtrasClassLoader = typeof(SapaAppInfo).ClassLoader;
            intent.putExtra("Edit_mode", mode);
            intent.Flags = Intent.FLAG_ACTIVITY_BROUGHT_TO_FRONT;

            context.startActivity(intent);

            return(true);
        }
Ejemplo n.º 2
0
 public override void onActivityResult(int requestCode, int resultCode, Intent data)
 {
     if (requestCode == REQUEST_CODE_SETTINGS)
     {
         if (posPrinter != null)
         {
             try
             {
                 posPrinter.close();
             }
             catch (JposException e)
             {
                 // TODO Auto-generated catch block
                 Console.WriteLine(e.ToString());
                 Console.Write(e.StackTrace);
             }
         }
         posPrinter = null;
     }
     else
     {
         Fragment fragment = SupportFragmentManager.findFragmentByTag(TAG_POS_PRINTER_BITMAP_FRAGMENT);
         if (fragment != null)
         {
             fragment.onActivityResult(requestCode, resultCode, data);
         }
         else
         {
             base.onActivityResult(requestCode, resultCode, data);
         }
     }
 }
		public override void onReceive(Context context, Intent intent)
		{
//JAVA TO C# CONVERTER WARNING: The .NET Type.FullName property will not always yield results identical to the Java Class.getName method:
			ComponentName comp = new ComponentName(context.PackageName, typeof(GcmIntentService).FullName);
			startWakefulService(context, (intent.setComponent(comp)));
			ResultCode = Activity.RESULT_OK;
		}
Ejemplo n.º 4
0
 /// <summary>Specify an intent to use to launch an activity as the tab content.</summary>
 /// <remarks>Specify an intent to use to launch an activity as the tab content.</remarks>
 public virtual android.widget.TabHost.TabSpec setContent(android.content.Intent intent
                                                          )
 {
     this.mContentStrategy = new android.widget.TabHost.IntentContentStrategy(this._enclosing
                                                                              , this.mTag, intent);
     return(this);
 }
Ejemplo n.º 5
0
 public override void sendStickyOrderedBroadcast(android.content.Intent intent, android.content.BroadcastReceiver
                                                 resultReceiver, android.os.Handler scheduler, int initialCode, string initialData
                                                 , android.os.Bundle initialExtras)
 {
     mBase.sendStickyOrderedBroadcast(intent, resultReceiver, scheduler, initialCode,
                                      initialData, initialExtras);
 }
Ejemplo n.º 6
0
		public virtual int addIntentOptions(int groupId, int itemId, int order, android.content.ComponentName
			 caller, android.content.Intent[] specifics, android.content.Intent intent, int 
			flags, android.view.MenuItem[] outSpecificItems)
		{
			android.content.pm.PackageManager pm = mContext.getPackageManager();
			java.util.List<android.content.pm.ResolveInfo> lri = pm.queryIntentActivityOptions
				(caller, specifics, intent, 0);
			int N = lri != null ? lri.size() : 0;
			if ((flags & android.view.MenuClass.FLAG_APPEND_TO_GROUP) == 0)
			{
				removeGroup(groupId);
			}
			{
				for (int i = 0; i < N; i++)
				{
					android.content.pm.ResolveInfo ri = lri.get(i);
					android.content.Intent rintent = new android.content.Intent(ri.specificIndex < 0 ? 
						intent : specifics[ri.specificIndex]);
					rintent.setComponent(new android.content.ComponentName(ri.activityInfo.applicationInfo
						.packageName, ri.activityInfo.name));
					android.view.MenuItem item = add(groupId, itemId, order, ri.loadLabel(pm)).setIcon
						(ri.loadIcon(pm)).setIntent(rintent);
					if (outSpecificItems != null && ri.specificIndex >= 0)
					{
						outSpecificItems[ri.specificIndex] = item;
					}
				}
			}
			return N;
		}
Ejemplo n.º 7
0
        public virtual void showPickerDialog()
        {
            Intent intent = new Intent(Activity, typeof(DeviceSelectActivity));

            intent.putExtra("deviceType", mType);
            startActivityForResult(intent, 0);
        }
Ejemplo n.º 8
0
		public override android.content.Intent getLaunchIntentForPackage(string packageName
			)
		{
			// First see if the package has an INFO activity; the existence of
			// such an activity is implied to be the desired front-door for the
			// overall package (such as if it has multiple launcher entries).
			android.content.Intent intentToResolve = new android.content.Intent(android.content.Intent
				.ACTION_MAIN);
			intentToResolve.addCategory(android.content.Intent.CATEGORY_INFO);
			intentToResolve.setPackage(packageName);
			java.util.List<android.content.pm.ResolveInfo> ris = queryIntentActivities(intentToResolve
				, 0);
			// Otherwise, try to find a main launcher activity.
			if (ris == null || ris.size() <= 0)
			{
				// reuse the intent instance
				intentToResolve.removeCategory(android.content.Intent.CATEGORY_INFO);
				intentToResolve.addCategory(android.content.Intent.CATEGORY_LAUNCHER);
				intentToResolve.setPackage(packageName);
				ris = queryIntentActivities(intentToResolve, 0);
			}
			if (ris == null || ris.size() <= 0)
			{
				return null;
			}
			android.content.Intent intent = new android.content.Intent(intentToResolve);
			intent.setFlags(android.content.Intent.FLAG_ACTIVITY_NEW_TASK);
			intent.setClassName(ris.get(0).activityInfo.packageName, ris.get(0).activityInfo.
				name);
			return intent;
		}
Ejemplo n.º 9
0
            protected internal override string doInBackground(params Void[] @params)
            {
                string token = null;

                try
                {
                    string scope = string.Format("oauth2:{0}", Scopes.PLUS_LOGIN);
                    token = GoogleAuthUtil.getToken(outerInstance, Plus.AccountApi.getAccountName(outerInstance.mGoogleApiClient), scope);
                }
                catch (IOException transientEx)
                {
                    /* Network or server error */
                    Log.e(TAG, "Error authenticating with Google: " + transientEx);
                    errorMessage = "Network error: " + transientEx.Message;
                }
                catch (UserRecoverableAuthException e)
                {
                    Log.w(TAG, "Recoverable Google OAuth error: " + e.ToString());
                    /* We probably need to ask for permissions, so start the intent if there is none pending */
                    if (!outerInstance.mGoogleIntentInProgress)
                    {
                        outerInstance.mGoogleIntentInProgress = true;
                        Intent recover = e.Intent;
                        startActivityForResult(recover, RC_GOOGLE_LOGIN);
                    }
                }
                catch (GoogleAuthException authEx)
                {
                    /* The call is not ever expected to succeed assuming you have already verified that
                     * Google Play services is installed. */
                    Log.e(TAG, "Error authenticating with Google: " + authEx.Message, authEx);
                    errorMessage = "Error authenticating with Google: " + authEx.Message;
                }
                return(token);
            }
Ejemplo n.º 10
0
        public override void onPause()
        {
            base.onPause();

            if (mSession != null)
            {
                mSession.onPause();
            }

            mNotifyBuilder = (new NotificationCompat.Builder(this)).setContentTitle(this.Title).setContentText(Resources.getString([email protected])).setSmallIcon(R.drawable.ic_launcher).setOngoing(true);

            Intent notificationIntent = new Intent(this, typeof(MultipartyActivity));

            notificationIntent.Flags = Intent.FLAG_ACTIVITY_CLEAR_TOP | Intent.FLAG_ACTIVITY_SINGLE_TOP;
            PendingIntent intent = PendingIntent.getActivity(this, 0, notificationIntent, 0);

            mNotifyBuilder.ContentIntent = intent;

            if (mConnection == null)
            {
                mConnection = new ServiceConnectionAnonymousInnerClassHelper(this);
            }

            if (!mIsBound)
            {
                bindService(new Intent(MultipartyActivity.this, typeof(ClearNotificationService)), mConnection, Context.BIND_AUTO_CREATE);
                mIsBound = true;
                startService(notificationIntent);
            }
        }
Ejemplo n.º 11
0
 internal IntentContentStrategy(TabHost _enclosing, string tag, android.content.Intent
                                intent)
 {
     this._enclosing = _enclosing;
     this.mTag       = tag;
     this.mIntent    = intent;
 }
Ejemplo n.º 12
0
 public virtual void onClick(android.view.View view)
 {
     if (view == this._enclosing.mDefaultActivityButton)
     {
         this._enclosing.dismissPopup();
         android.content.pm.ResolveInfo defaultActivity = this._enclosing.mAdapter.getDefaultActivity
                                                              ();
         int index = this._enclosing.mAdapter.getDataModel().getActivityIndex(defaultActivity
                                                                              );
         android.content.Intent launchIntent = this._enclosing.mAdapter.getDataModel().chooseActivity
                                                   (index);
         if (launchIntent != null)
         {
             this._enclosing.mContext.startActivity(launchIntent);
         }
     }
     else
     {
         if (view == this._enclosing.mExpandActivityOverflowButton)
         {
             this._enclosing.mIsSelectingDefaultActivity = false;
             this._enclosing.showPopupUnchecked(this._enclosing.mInitialActivityCount);
         }
         else
         {
             throw new System.ArgumentException();
         }
     }
 }
Ejemplo n.º 13
0
 public virtual void unbindRemoteViewsService(int appWidgetId, android.content.Intent
                                              intent)
 {
     android.os.Parcel _data  = android.os.Parcel.obtain();
     android.os.Parcel _reply = android.os.Parcel.obtain();
     try
     {
         _data.writeInterfaceToken(DESCRIPTOR);
         _data.writeInt(appWidgetId);
         if ((intent != null))
         {
             _data.writeInt(1);
             intent.writeToParcel(_data, 0);
         }
         else
         {
             _data.writeInt(0);
         }
         mRemote.transact(android.appwidget.@internal.IAppWidgetServiceClass.Stub.TRANSACTION_unbindRemoteViewsService
                          , _data, _reply, 0);
         _reply.readException();
     }
     finally
     {
         _reply.recycle();
         _data.recycle();
     }
 }
Ejemplo n.º 14
0
        public virtual int addIntentOptions(int groupId, int itemId, int order, android.content.ComponentName
                                            caller, android.content.Intent[] specifics, android.content.Intent intent, int
                                            flags, android.view.MenuItem[] outSpecificItems)
        {
            android.content.pm.PackageManager pm = mContext.getPackageManager();
            java.util.List <android.content.pm.ResolveInfo> lri = pm.queryIntentActivityOptions
                                                                      (caller, specifics, intent, 0);
            int N = lri != null?lri.size() : 0;

            if ((flags & android.view.MenuClass.FLAG_APPEND_TO_GROUP) == 0)
            {
                removeGroup(groupId);
            }
            {
                for (int i = 0; i < N; i++)
                {
                    android.content.pm.ResolveInfo ri      = lri.get(i);
                    android.content.Intent         rintent = new android.content.Intent(ri.specificIndex < 0 ?
                                                                                        intent : specifics[ri.specificIndex]);
                    rintent.setComponent(new android.content.ComponentName(ri.activityInfo.applicationInfo
                                                                           .packageName, ri.activityInfo.name));
                    android.view.MenuItem item = add(groupId, itemId, order, ri.loadLabel(pm)).setIcon
                                                     (ri.loadIcon(pm)).setIntent(rintent);
                    if (outSpecificItems != null && ri.specificIndex >= 0)
                    {
                        outSpecificItems[ri.specificIndex] = item;
                    }
                }
            }
            return(N);
        }
Ejemplo n.º 15
0
        public override void onReceive(Context arg0, Intent arg1)
        {
            Intent i = new Intent(arg0, typeof(com.samsung.android.sdk.accessory.example.galleryconsumer.GalleryConsumerActivity));

            i.Flags = Intent.FLAG_ACTIVITY_NEW_TASK;
            arg0.startActivity(i);
        }
        /*
         * Send the IncomingCallMessage to the VoiceActivity
         */
        private void sendIncomingCallMessageToActivity(IncomingCallMessage incomingCallMessage, int notificationId)
        {
            Intent intent = new Intent(VoiceActivity.ACTION_INCOMING_CALL);

            intent.putExtra(VoiceActivity.INCOMING_CALL_MESSAGE, incomingCallMessage);
            intent.putExtra(VoiceActivity.INCOMING_CALL_NOTIFICATION_ID, notificationId);
            LocalBroadcastManager.getInstance(this).sendBroadcast(intent);
        }
Ejemplo n.º 17
0
        public override void onReceive(Context context, Intent intent)
        {
//JAVA TO C# CONVERTER WARNING: The .NET Type.FullName property will not always yield results identical to the Java Class.getName method:
            ComponentName comp = new ComponentName(context.PackageName, typeof(GcmIntentService).FullName);

            startWakefulService(context, (intent.setComponent(comp)));
            ResultCode = Activity.RESULT_OK;
        }
Ejemplo n.º 18
0
            protected internal override void onPostExecute(string token)
            {
                outerInstance.mGoogleLoginClicked = false;
                Intent intentWithToken = new Intent(outerInstance, typeof(OfficeMoverActivity));

                intentWithToken.putExtra(AUTH_TOKEN_EXTRA, token);
                startActivity(intentWithToken);
            }
Ejemplo n.º 19
0
        private void openActivity(string phoneNumber, string method)
        {
            Intent verification = new Intent(this, typeof(VerificationActivity));

            verification.putExtra(INTENT_PHONENUMBER, phoneNumber);
            verification.putExtra(INTENT_METHOD, method);
            startActivity(verification);
        }
        public override void onReceive(Context context, Intent intent)
        {
            bool isConnected = intent.getBooleanExtra("isConnected", false);

            Log.d(TAG, "Connected : " + isConnected);

            Toast.makeTextuniquetempvar.show();
        }
Ejemplo n.º 21
0
        protected override void onNewIntent(android.content.Intent value)
        {
            base.onNewIntent(value);
            var DataString = value.getDataString();

            Console.WriteLine("exit onNewIntent " + new { DataString });

            // https://sites.google.com/a/jsc-solutions.net/work/knowledge-base/15-dualvr/20150704/pui_global_menu
        }
		public override void onReceive(Context context, Intent intent)
		{
			bool isConnected = intent.getBooleanExtra("isConnected", false);

			Log.d(TAG, "Connected : " + isConnected);

			Toast.makeTextuniquetempvar.show();

		}
Ejemplo n.º 23
0
 public virtual void scheduleLaunchActivity(android.content.Intent intent, android.os.IBinder
                                            token, int ident, android.content.pm.ActivityInfo info, android.content.res.Configuration
                                            curConfig, android.content.res.CompatibilityInfo compatInfo, android.os.Bundle
                                            state, java.util.List <android.app.ResultInfo> pendingResults, java.util.List <android.content.Intent
                                                                                                                           > pendingNewIntents, bool notResumed, bool isForward, string profileName, android.os.ParcelFileDescriptor
                                            profileFd, bool autoStopProfiler)
 {
     throw new System.NotImplementedException();
 }
		public override void onTokenRefresh()
		{
			base.onTokenRefresh();

			Log.d(TAG, "onTokenRefresh");

			Intent intent = new Intent(this, typeof(GCMRegistrationService));
			startService(intent);
		}
Ejemplo n.º 25
0
            public override void onIncomingCall(CallClient callClient, Call call)
            {
                Log.d(TAG, "onIncomingCall: " + call.CallId);
                Intent intent = new Intent(outerInstance, typeof(IncomingCallScreenActivity));

                intent.putExtra(CALL_ID, call.CallId);
                intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
                outerInstance.startActivity(intent);
            }
Ejemplo n.º 26
0
        public override void onReceive(Context context, Intent intent)
        {
            string data = intent.getStringExtra("extra_action_data");

            if (data != null)
            {
                Toast.makeText(context, data, Toast.LENGTH_SHORT).show();
            }
        }
Ejemplo n.º 27
0
        private void readIntent(Intent intent)
        {
            SapaAppInfo info = SapaAppInfo.getAppInfo(intent);

            if (info != null)
            {
                this.mVisibleAppInfo = info;
            }
        }
Ejemplo n.º 28
0
	  internal override Intent buildIntent()
	  {
		Intent intent = new Intent(INTENT_ACTION);
		string category = Category;
		if (category != null)
		{
		  intent.addCategory(category);
		}
		return intent;
	  }
		public override void onReceive(Context context, Intent intent)
		{

			string data = intent.getStringExtra("extra_action_data");

			if (data != null)
			{
				Toast.makeText(context, data, Toast.LENGTH_SHORT).show();
			}
		}
        public override void onTokenRefresh()
        {
            base.onTokenRefresh();

            Log.d(TAG, "onTokenRefresh");

            Intent intent = new Intent(this, typeof(GCMRegistrationService));

            startService(intent);
        }
Ejemplo n.º 31
0
        internal override Intent buildIntent()
        {
            Intent intent   = new Intent(INTENT_ACTION);
            string category = Category;

            if (category != null)
            {
                intent.addCategory(category);
            }
            return(intent);
        }
Ejemplo n.º 32
0
        private void pickAlbum()
        {
            string externalStorageState = Environment.ExternalStorageState;

            if (externalStorageState.Equals(Environment.MEDIA_MOUNTED))
            {
                Intent intent = new Intent(Intent.ACTION_PICK);
                intent.Type = MediaStore.Images.Media.CONTENT_TYPE;
                startActivityForResult(intent, REQUEST_CODE_ACTION_PICK);
            }
        }
Ejemplo n.º 33
0
            public override void onReceive(Context context, Intent intent)
            {
                if (intent.Action.Equals(MainActivity.ACTION_COMPLETE_PROCESS_BITMAP))
                {
                    sbyte[] pixels = intent.getByteArrayExtra(MainActivity.EXTRA_NAME_BITMAP_PIXELS);
                    int     width  = intent.getIntExtra(MainActivity.EXTRA_NAME_BITMAP_WIDTH, 0);
                    int     height = intent.getIntExtra(MainActivity.EXTRA_NAME_BITMAP_HEIGHT, 0);

                    outerInstance.printBitmap(pixels, width, height);
                }
            }
Ejemplo n.º 34
0
        /// <summary>
        /// Called when download times out. </summary>
        /// <param name="context"> application context. </param>
        /// <param name="intent"> timeout intent containing content identifier. </param>
        private void onDownloadTimeout(Context context, Intent intent)
        {
            /* Delegate to agent */
            EngagementReachAgent reachAgent           = EngagementReachAgent.getInstance(context);
            EngagementReachInteractiveContent content = reachAgent.getContent(intent);

            if (content != null)
            {
                reachAgent.onDownloadTimeout(content);
            }
        }
Ejemplo n.º 35
0
		protected internal override void onHandleIntent(Intent intent)
		{
			if (SinchHelpers.isSinchPushIntent(intent))
			{
				mIntent = intent;
				connectToService();
			}
			else
			{
				GcmBroadcastReceiver.completeWakefulIntent(intent);
			}
		}
	  /// <summary>
	  /// Called when a push message is received or message download completes. </summary>
	  /// <param name="context"> context. </param>
	  /// <param name="intent"> intent. </param>
	  private void onMessage(Context context, Intent intent)
	  {
		string type = intent.getStringExtra(INTENT_EXTRA_TYPE);
		if (INTENT_EXTRA_TYPE_PUSH.Equals(type))
		{
		  EngagementReachAgent.getInstance(context).onContentReceived(intent.Extras);
		}
		else if (INTENT_EXTRA_TYPE_DLC.Equals(type))
		{
		  EngagementReachAgent.getInstance(context).onMessageDownloaded(intent.Extras);
		}
	  }
Ejemplo n.º 37
0
 public virtual global::android.widget.TabHost.TabSpec setContent(android.content.Intent arg0)
 {
     global::MonoJavaBridge.JNIEnv @__env = global::MonoJavaBridge.JNIEnv.ThreadEnv;
     if (!IsClrObject)
     {
         return(global::MonoJavaBridge.JavaBridge.WrapJavaObject(@__env.CallObjectMethod(this.JvmHandle, global::android.widget.TabHost.TabSpec._setContent12018, global::MonoJavaBridge.JavaBridge.ConvertToValue(arg0))) as android.widget.TabHost.TabSpec);
     }
     else
     {
         return(global::MonoJavaBridge.JavaBridge.WrapJavaObject(@__env.CallNonVirtualObjectMethod(this.JvmHandle, global::android.widget.TabHost.TabSpec.staticClass, global::android.widget.TabHost.TabSpec._setContent12018, global::MonoJavaBridge.JavaBridge.ConvertToValue(arg0))) as android.widget.TabHost.TabSpec);
     }
 }
Ejemplo n.º 38
0
        /// <summary>
        /// Called when a notification has been exited (clear button from notification panel). </summary>
        /// <param name="context"> context. </param>
        /// <param name="intent"> intent containing the content identifier to exit. </param>
        private void onNotificationExited(Context context, Intent intent)
        {
            /* Get content */
            EngagementReachAgent reachAgent           = EngagementReachAgent.getInstance(context);
            EngagementReachInteractiveContent content = reachAgent.getContent(intent);

            /* Exit it if found */
            if (content != null)
            {
                content.exitNotification(context);
            }
        }
Ejemplo n.º 39
0
 public virtual void sendIntent(android.content.Context arg0, int arg1, android.content.Intent arg2, android.content.IntentSender.OnFinished arg3, android.os.Handler arg4)
 {
     global::MonoJavaBridge.JNIEnv @__env = global::MonoJavaBridge.JNIEnv.ThreadEnv;
     if (!IsClrObject)
     {
         @__env.CallVoidMethod(this.JvmHandle, global::android.content.IntentSender._sendIntent1724, global::MonoJavaBridge.JavaBridge.ConvertToValue(arg0), global::MonoJavaBridge.JavaBridge.ConvertToValue(arg1), global::MonoJavaBridge.JavaBridge.ConvertToValue(arg2), global::MonoJavaBridge.JavaBridge.ConvertToValue(arg3), global::MonoJavaBridge.JavaBridge.ConvertToValue(arg4));
     }
     else
     {
         @__env.CallNonVirtualVoidMethod(this.JvmHandle, global::android.content.IntentSender.staticClass, global::android.content.IntentSender._sendIntent1724, global::MonoJavaBridge.JavaBridge.ConvertToValue(arg0), global::MonoJavaBridge.JavaBridge.ConvertToValue(arg1), global::MonoJavaBridge.JavaBridge.ConvertToValue(arg2), global::MonoJavaBridge.JavaBridge.ConvertToValue(arg3), global::MonoJavaBridge.JavaBridge.ConvertToValue(arg4));
     }
 }
			public virtual void onClick(View v)
			{
				Intent intent = new Intent();
				intent.Component = new ComponentName("com.samsung.android.app.pinboard", "com.samsung.android.app.pinboard.ui.PinboardActivity");
				try
				{
					startActivity(intent);
				}
				catch (ActivityNotFoundException)
				{
					Toast.makeText(outerInstance, "Pinboard application is not installed.", Toast.LENGTH_SHORT).show();
				}
			}
		public override void onActivityResult(int requestCode, int resultCode, Intent data)
		{
			base.onActivityResult(requestCode, resultCode, data);

			if (requestCode == REQUEST_CODE_ACTION_PICK)
			{
				if (data != null)
				{
					Uri uri = data.Data;
					System.IO.Stream @is = null;
					try
					{
						@is = ContentResolver.openInputStream(uri);
					}
					catch (FileNotFoundException e)
					{
						Console.WriteLine(e.ToString());
						Console.Write(e.StackTrace);
						return;
					}

					try
					{
					BitmapFactory.Options opts = new BitmapFactory.Options();
					opts.inJustDecodeBounds = false;
					opts.inSampleSize = 1;
					opts.inPreferredConfig = Bitmap.Config.RGB_565;
					Bitmap bm = BitmapFactory.decodeStream(@is, null, opts);
					mImageView.ImageBitmap = bm;
					}
					catch (System.OutOfMemoryException e)
					{
						Console.WriteLine(e.ToString());
						Console.Write(e.StackTrace);
						return;
					}

					ContentResolver cr = ContentResolver;
					Cursor c = cr.query(uri, new string[] {MediaStore.Images.Media.DATA}, null, null, null);
					if (c == null || c.Count == 0)
					{
						return;
					}
					c.moveToFirst();
					int columnIndex = c.getColumnIndexOrThrow(MediaStore.Images.Media.DATA);
					string text = c.getString(columnIndex);
					mTextView.Text = text;
				}
			}
		}
		private void callButtonClicked()
		{
			string userName = mCallName.Text.ToString();
			if (userName.Length == 0)
			{
				Toast.makeText(this, "Please enter a user to call", Toast.LENGTH_LONG).show();
				return;
			}

			Call call = SinchServiceInterface.callUser(userName);
			string callId = call.CallId;

			Intent callScreen = new Intent(this, typeof(CallScreenActivity));
			callScreen.putExtra(SinchService.CALL_ID, callId);
			startActivity(callScreen);
		}
	  public override void onReceive(Context context, Intent intent)
	  {
		/* Handle push message */
		string category = intent.getStringExtra("category");
		string body = intent.getStringExtra("body");
		string type = intent.getStringExtra("type");
		if (body == null || type == null)
		{
		  return;
		}

		/* If text then use onDataPushStringReceived function */
		bool? result;
		if (type.Equals("text/plain"))
		{
		  result = onDataPushStringReceived(context, category, body);
		}

		/* If base64 or binary file then use onDataPushBinaryReceived function */
		else if (type.Equals("text/base64"))
		{
		  result = onDataPushBase64Received(context, category, Base64.decode(body, DEFAULT), body);
		}

		/* Unknown type */
		else
		{
		  return;
		}

		/* Set result if defined */
		if (result == null)
		{
		  return;
		}
		int code;
		if (result.Value)
		{
		  code = RESULT_OK;
		}
		else
		{
		  code = RESULT_CANCELED;
		}
		setResult(code, null, null);
	  }
	  public override void onReceive(Context context, Intent intent)
	  {
		/* Big picture downloaded */
		if (DownloadManager.ACTION_DOWNLOAD_COMPLETE.Equals(intent.Action))
		{
		  /* Get content by download id */
		  long downloadId = intent.getLongExtra(DownloadManager.EXTRA_DOWNLOAD_ID, 0);
		  EngagementReachAgent reachAgent = EngagementReachAgent.getInstance(context);
		  EngagementReachInteractiveContent content = reachAgent.getContentByDownloadId(downloadId);

		  /* Delegate to agent if content found */
		  if (content != null)
		  {
			reachAgent.onDownloadComplete(content);
		  }
		}
	  }
			public virtual bool shouldOverrideUrlLoading(WebView view, string url)
			{
				Log.d(outerInstance.TAG, "Loading URL: " + url);

				// if we detect a redirect to our application URL, this is an indication
				// that the authN workflow was completed successfully
				if (url.Equals(URLDecoder.decode(AccessEnabler.ADOBEPASS_REDIRECT_URL)))
				{

					// the authentication workflow is now complete - go back to the main activity
					Intent result = new Intent(outerInstance, typeof(MainActivity));
					setResult(RESULT_OK, result);
					finish();
				}

				return false;
			}
Ejemplo n.º 46
0
		/// <summary>
		/// This method is responsible for updating visible SapaAppInfo and sets state of view
		/// accordingly.
		/// </summary>
		/// <param name="intent">
		///            Intent received when activity is shown. </param>
		private void readIntent(Intent intent)
		{
			SapaAppInfo info = SapaAppInfo.getAppInfo(intent);
			if (info != null)
			{
				this.mVisibleAppInfo = info;
				if (this.mVisibleAppInfo.getActionInfo(ACTION_PLAY) != null)
				{
					if (this.mVisibleAppInfo.getActionInfo(ACTION_PLAY).Visible)
					{
						this.changeButtonsOnStop();
					}
					else
					{
						this.changeButtonsOnPlay();
					}
				}
			}
		}
Ejemplo n.º 47
0
		public override void onServiceConnected(ComponentName componentName, IBinder iBinder)
		{
			if (mIntent == null)
			{
				return;
			}

			if (SinchHelpers.isSinchPushIntent(mIntent))
			{
				SinchService.SinchServiceInterface sinchService = (SinchService.SinchServiceInterface) iBinder;
				if (sinchService != null)
				{
					NotificationResult result = sinchService.relayRemotePushNotificationPayload(mIntent);
					// handle result, e.g. show a notification or similar
				}
			}

			GcmBroadcastReceiver.completeWakefulIntent(mIntent);
			mIntent = null;
		}
		public override void onReceive(Context context, Intent intent)
		{
			base.onReceive(context, intent);
			if (intent.Action == Constants.COCKTAIL_LIST_ADAPTER_CLICK_ACTION)
			{
				PendingIntent p = intent.getParcelableExtra(Constants.EXTRA_CONTENT_INTENT);
				if (p != null)
				{
					try
					{
						p.send();
					}
					catch (PendingIntent.CanceledException e)
					{
						Console.WriteLine(e.ToString());
						Console.Write(e.StackTrace);
					}
				}
			}

		}
		public override void onUpdate(Context context, SlookCocktailManager cocktailManager, int[] cocktailIds)
		{
			Intent intent = new Intent(context, typeof(CocktailListAdapterService));
			intent.Data = Uri.parse(intent.toUri(Intent.URI_INTENT_SCHEME));

			RemoteViews views = new RemoteViews(context.PackageName, R.layout.widget_layout);

			views.setRemoteAdapter(R.id.widgetlist, intent);
			views.setEmptyView(R.id.widgetlist, R.id.emptylist);

			Intent itemClickIntent = new Intent(context, typeof(CocktailListAdapterProvider));
			itemClickIntent.Action = Constants.COCKTAIL_LIST_ADAPTER_CLICK_ACTION;

			PendingIntent itemClickPendingIntent = PendingIntent.getBroadcast(context, 1, itemClickIntent, PendingIntent.FLAG_UPDATE_CURRENT);
			views.setPendingIntentTemplate(R.id.widgetlist, itemClickPendingIntent);

			for (int i = 0; i < cocktailIds.Length; i++)
			{
				cocktailManager.updateCocktail(cocktailIds[i], views);
			}
		}
	  public override void onReceive(Context context, Intent intent)
	  {
		/* Registration result action */
		string action = intent.Action;
		if (INTENT_ACTION_REGISTRATION.Equals(action))
		{
		  /* Handle register if successful (otherwise we'll retry next time process is started) */
		  string registrationId = intent.getStringExtra(INTENT_EXTRA_REGISTRATION);
		  if (registrationId != null)
		  {
			EngagementNativePushAgent nativePushAgent = EngagementNativePushAgent.getInstance(context);
			nativePushAgent.registerNativePush(new EngagementNativePushToken(registrationId, ADM));
		  }
		}

		/* Received message action */
		else if (INTENT_ACTION_RECEIVE.Equals(action))
		{
		  EngagementNativePushAgent.getInstance(context).onPushReceived(intent.Extras);
		}
	  }
	  public override void onReceive(Context context, Intent intent)
	  {
		/* Boot: restore system notifications */
		string action = intent.Action;
		if (Intent.ACTION_BOOT_COMPLETED.Equals(action))
		{
		  EngagementReachAgent.getInstance(context).onDeviceBoot();
		}

		/* Just ensure the reach agent is loaded for checking pending contents in SQLite */
		else if (EngagementAgent.INTENT_ACTION_AGENT_CREATED.Equals(action))
		{
		  EngagementReachAgent.getInstance(context);
		}

		/* Notification actioned e.g. clicked (from the system notification) */
		else if (EngagementReachAgent.INTENT_ACTION_ACTION_NOTIFICATION.Equals(action))
		{
		  onNotificationActioned(context, intent);
		}

		/* System notification exited (clear button) */
		else if (EngagementReachAgent.INTENT_ACTION_EXIT_NOTIFICATION.Equals(action))
		{
		  onNotificationExited(context, intent);
		}

		/* Called when download takes too much time to complete */
		else if (EngagementReachAgent.INTENT_ACTION_DOWNLOAD_TIMEOUT.Equals(action))
		{
		  onDownloadTimeout(context, intent);
		}

		/* Called when we receive GCM or ADM push with azme parameters or message download completes. */
		else if (EngagementIntents.INTENT_ACTION_MESSAGE.Equals(action))
		{
		  onMessage(context, intent);
		}
	  }
		private void callButtonClicked()
		{
			string userName = mCallName.Text.ToString();
			if (userName.Length == 0)
			{
				Toast.makeText(this, "Please enter a user to call", Toast.LENGTH_LONG).show();
				return;
			}

			try
			{
				Call call = SinchServiceInterface.callUser(userName);
				string callId = call.CallId;
				Intent callScreen = new Intent(this, typeof(CallScreenActivity));
				callScreen.putExtra(SinchService.CALL_ID, callId);
				startActivity(callScreen);
			}
			catch (MissingPermissionException e)
			{
				ActivityCompat.requestPermissions(this, new string[]{e.RequiredPermission}, 0);
			}

		}
Ejemplo n.º 53
0
		public android.view.MenuItem setIntent(android.content.Intent intent)
		{
			mIntent = intent;
			return this;
		}
Ejemplo n.º 54
0
		public virtual void showPickerDialog()
		{
			Intent intent = new Intent(Activity, typeof(DeviceSelectActivity));
			intent.putExtra("deviceType", mType);
			startActivityForResult(intent, 0);
		}
Ejemplo n.º 55
0
		/// <summary>
		/// Callback when user has selected device in device select activity.
		/// </summary>
		public override void onActivityResult(int requestCode, int resultCode, Intent data)
		{
			if (resultCode == Activity.RESULT_OK)
			{
				mDeviceId = data.getStringExtra("deviceId");
				int type = data.getIntExtra("deviceType", -1);

				if (mDeviceFinder != null && mPickerListener != null)
				{
					SmcDevice d = mDeviceFinder.getDevice(type, mDeviceId);
					if (d != null)
					{
						mPickerListener.onDeviceSelected(d);
						Active = true;
					}
				}
			}
		}
		private void pickAlbum()
		{
			string externalStorageState = Environment.ExternalStorageState;
			if (externalStorageState.Equals(Environment.MEDIA_MOUNTED))
			{
				Intent intent = new Intent(Intent.ACTION_PICK);
				intent.Type = MediaStore.Images.Media.CONTENT_TYPE;
				startActivityForResult(intent, REQUEST_CODE_ACTION_PICK);
			}
		}
Ejemplo n.º 57
0
		public override IBinder onBind(Intent intent)
		{
			// TODO Auto-generated method stub
			return null;
		}
	  /// <summary>
	  /// Called when download times out. </summary>
	  /// <param name="context"> application context. </param>
	  /// <param name="intent"> timeout intent containing content identifier. </param>
	  private void onDownloadTimeout(Context context, Intent intent)
	  {
		/* Delegate to agent */
		EngagementReachAgent reachAgent = EngagementReachAgent.getInstance(context);
		EngagementReachInteractiveContent content = reachAgent.getContent(intent);
		if (content != null)
		{
		  reachAgent.onDownloadTimeout(content);
		}
	  }
	  /// <summary>
	  /// Called when a notification has been exited (clear button from notification panel). </summary>
	  /// <param name="context"> context. </param>
	  /// <param name="intent"> intent containing the content identifier to exit. </param>
	  private void onNotificationExited(Context context, Intent intent)
	  {
		/* Get content */
		EngagementReachAgent reachAgent = EngagementReachAgent.getInstance(context);
		EngagementReachInteractiveContent content = reachAgent.getContent(intent);

		/* Exit it if found */
		if (content != null)
		{
		  content.exitNotification(context);
		}
	  }
	  /// <summary>
	  /// Called when a system notification for a content has been actioned. </summary>
	  /// <param name="context"> context. </param>
	  /// <param name="intent"> intent describing the content. </param>
	  private void onNotificationActioned(Context context, Intent intent)
	  {
		/* Get content */
		EngagementReachAgent reachAgent = EngagementReachAgent.getInstance(context);
		EngagementReachInteractiveContent content = reachAgent.getContent(intent);

		/* If content retrieved successfully */
		if (content != null)

		  /* Tell reach to start the content activity */
		{
		  content.actionNotification(context, true);
		}
	  }