I'm doing an App that acts like a Browser though we wish to grant a user
to call his "second" comparison Browser with a symbol from my
Browser.Because of that, my App is a Browser, we can't call a common
ACTION_VIEW Intent, if we did that my possess App will seem on a
chooser.So, we finished a Preferences Screen that grant we to set your
comparison browser. To fill a ListPreference with a accessible Browsers we
use something like that: Uri uri = Uri.parse("http://google.com");
Intent vigilant = new Intent(Intent.ACTION_VIEW, uri); List
allActivities = ctx.getPackageManager().queryIntentActivities(intent,
0);Loop a list and build a preference, we store on SharedPreferences a
package name for after use: ((ActivityInfo)
ri.activityInfo).packageNameWhen user daub a "open my comparison browser"
symbol we plead a Browser Activity like that (I loop again by ResolveInfo
since we don't store a challenging form like an ActivityInfo:Uri uri =
Uri.parse("http://google.com");Intent vigilant = new
Intent(Intent.ACTION_VIEW, uri);List allActivities =
mContext.getPackageManager().queryIntentActivities(intent, 0);ActivityInfo
activity = null;for (ResolveInfo ri : allActivities) { String
browserAction = ((ActivityInfo) ri.activityInfo).packageName; if
(sharedPrefs.getString(Constants.KEY_PREFERRED_BROWSER,"").equals(browserAction))
{ activity = ri.activityInfo; break; } } if
(activity != null) { Log.e(TAG,finalUrl); ComponentName name = new
ComponentName(activity.applicationInfo.packageName, activity.name);
Intent i=new Intent(Intent.ACTION_MAIN, Uri.parse(finalUrl)); // TRY 1,
set URL on Intent constructor
i.putExtra(Intent.EXTRA_TEXT,Uri.parse(finalUrl)); // Try 2, put an EXTRA
with a URL :P i.addCategory(Intent.CATEGORY_LAUNCHER);
i.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK |
Intent.FLAG_ACTIVITY_RESET_TASK_IF_NEEDED); i.setComponent(name);
i.setData(Uri.parse(finalUrl)); // Try 3, set URL as Intent Data
startActivity(i);}Well... as we can see we attempted many things... I'm
contrast on a Genymotion simulator with Android default browser, Chrome
and Firefox, and wholly Chrome is loading a URL correctly.Do we know how
can we set a URL to a vigilant justly for any case? Could we infer how to
do it, for example, when user is selecting his comparison Browser in my
Preferences Screen? Maybe an easier approach? 0:-)Thank we unequivocally
much.
Tuesday, 8 April 2014
Friday, 4 April 2014
@SuppressWarnings some-more than one order not working
PMD and SonarQube a good collection though we have problems perplexing to
conceal PMD warnings.We use Lombok a lot in the project, so many of a
denote classes have a:@SuppressWarnings("PMD.UnusedPrivateField")as an
class-level annotations.This works fine.The problem is, that if we wan't
to replace one some-more rule, we would design a following
syntax:@SuppressWarnings(value = { "PMD.UnusedPrivateField",
"PMD.SingularField" })This looks like a repremand syntax, also reading a
doing of a PMD annotation.However, this seems not to works:None of a
manners are now suppressed.
conceal PMD warnings.We use Lombok a lot in the project, so many of a
denote classes have a:@SuppressWarnings("PMD.UnusedPrivateField")as an
class-level annotations.This works fine.The problem is, that if we wan't
to replace one some-more rule, we would design a following
syntax:@SuppressWarnings(value = { "PMD.UnusedPrivateField",
"PMD.SingularField" })This looks like a repremand syntax, also reading a
doing of a PMD annotation.However, this seems not to works:None of a
manners are now suppressed.
Tuesday, 1 April 2014
MQRC_OBJECT_ALREADY_EXISTS blunder formula 2100
I am Using IBM WebSphere MQ. Whenever coexisting users record in to a IBM
MQ, when a second user comes and try to opening a getqueue they accept
2100 0x00000834 MQRC_OBJECT_ALREADY_EXISTS error. Kindly yield some
suggestion.Connect to MQ Manager:mqQueueManager = new
MQQueueManager(mqQueueManagerName);Open Put Queue:mqPutQueue =
mqQueueManager.AccessQueue(mqRequestQueueName, MQC.MQOO_INQUIRE |
MQC.MQOO_OUTPUT | MQC.MQOO_FAIL_IF_QUIESCING);Opening a ReplyTo Queue
generates a blunder when a second user tries to connect. The First user's
enterprising reserve will be deleted when they disconnect. That Second
user is amateurish to connect, until a initial user closes a
application:mqGetQueue = mqQueueManager.AccessQueue(mqModelQueueName,
MQC.MQOO_INPUT_SHARED , mqQueueManagerName, mqReplyQueueName, "");
MQ, when a second user comes and try to opening a getqueue they accept
2100 0x00000834 MQRC_OBJECT_ALREADY_EXISTS error. Kindly yield some
suggestion.Connect to MQ Manager:mqQueueManager = new
MQQueueManager(mqQueueManagerName);Open Put Queue:mqPutQueue =
mqQueueManager.AccessQueue(mqRequestQueueName, MQC.MQOO_INQUIRE |
MQC.MQOO_OUTPUT | MQC.MQOO_FAIL_IF_QUIESCING);Opening a ReplyTo Queue
generates a blunder when a second user tries to connect. The First user's
enterprising reserve will be deleted when they disconnect. That Second
user is amateurish to connect, until a initial user closes a
application:mqGetQueue = mqQueueManager.AccessQueue(mqModelQueueName,
MQC.MQOO_INPUT_SHARED , mqQueueManagerName, mqReplyQueueName, "");
Subscribe to:
Comments (Atom)