Intent plecoIntent = new Intent(Intent.ACTION_MAIN);
plecoIntent.setComponent(new ComponentName("com.pleco.chinesesystem","com.pleco.chinesesystem.PlecoDroidMainActivity"));
plecoIntent.addCategory(Intent.CATEGORY_LAUNCHER);
plecoIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_CLEAR_TOP | Intent.FLAG_ACTIVITY_SINGLE_TOP);
plecoIntent.putExtra(“launch_section", “dictSearch”);
plecoIntent.putExtra("replacesearchtext”, INSERT_YOUR_SEARCH_TEXT_HERE);
startActivity(plecoIntent);
We do have an API for looking up words in our search box if that's what you want - here's some sample code:
Code:Intent plecoIntent = new Intent(Intent.ACTION_MAIN); plecoIntent.setComponent(new ComponentName("com.pleco.chinesesystem","com.pleco.chinesesystem.PlecoDroidMainActivity")); plecoIntent.addCategory(Intent.CATEGORY_LAUNCHER); plecoIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_CLEAR_TOP | Intent.FLAG_ACTIVITY_SINGLE_TOP); plecoIntent.putExtra(“launch_section", “dictSearch”); plecoIntent.putExtra("replacesearchtext”, INSERT_YOUR_SEARCH_TEXT_HERE); startActivity(plecoIntent);
Not something we support yet - should be coming within the next few minor updates, though, probably through a URL rather than intent (we added URL support for searches in a recent update) since it's easier for people to integrate and works with mobile websites along with native apps.
There's not currently a URI equivalent on Android - you can easily launch Pleco from an intent but not from a URI.
There wasn't back then, but we added one in 3.2.10:
http://android.pleco.com/manual/310/vershist.html
javascript:window.location='plecoapi://x-callback-url/s?q=放松'
String url = "plecoapi://x-callback-url/s?q=放松";
Intent browserIntent = new Intent(Intent.ACTION_VIEW, Uri.parse(url));
startActivity(browserIntent);
though, probably through a URL rather than intent (we added URL support for searches in a recent update) since it's easier for people to integrate and works with mobile websites along with native apps.
Hmm... are you sure you're using the latest version of Pleco?
Is this because your app is always in landscape? And it's currently switching back to portrait when you open Pleco?
Is this likewise an app interface thing?
String url = "plecoapi://x-callback-url/s?q=" + word_to_look_for;
Intent browserIntent = new Intent(Intent.ACTION_VIEW, Uri.parse(url));
startActivity(browserIntent);
keyboard opening is dealt with for our next build
but we weren't able to reproduce your problem with landscape orientation; is your app forcing landscape orientation on a device that would otherwise be in portrait?
plecoapi://x-callback-url/s?q=word_to_look_for&is_landscape=1