HtmlDisplayActivity activity;
+ public static void quickdicUrlToIntent(final String url, final Intent intent) {
+ int firstColon = url.indexOf("?");
+ if (firstColon == -1)
+ return;
+ int secondColon = url.indexOf("&", firstColon + 1);
+ if (secondColon == -1)
+ return;
+ intent.putExtra(C.SEARCH_TOKEN, StringUtil.decodeFromUrl(url.substring(secondColon + 1)));
+ }
+
public MyWebView(Context context) {
super(context);
}
if (HtmlEntry.isQuickdicUrl(url)) {
Log.d(LOG, "Handling Quickdic URL: " + url);
final Intent result = new Intent();
- HtmlEntry.quickdicUrlToIntent(url, result);
+ quickdicUrlToIntent(url, result);
Log.d(LOG, "SEARCH_TOKEN=" + result.getStringExtra(C.SEARCH_TOKEN));
activity.setResult(Activity.RESULT_OK, result);
activity.finish();
package com.hughes.android.dictionary.engine;
-import android.content.Intent;
-import android.util.Log;
-
import com.hughes.android.dictionary.C;
import com.hughes.util.StringUtil;
import com.hughes.util.raf.RAFListSerializer;
return url.startsWith("q://d?");
}
- public static void quickdicUrlToIntent(final String url, final Intent intent) {
- int firstColon = url.indexOf("?");
- if (firstColon == -1)
- return;
- int secondColon = url.indexOf("&", firstColon + 1);
- if (secondColon == -1)
- return;
- intent.putExtra(C.SEARCH_TOKEN, StringUtil.decodeFromUrl(url.substring(secondColon + 1)));
- }
-
// --------------------------------------------------------------------
public static final class LazyHtmlLoader {