Okhelp.cz

Recepty, články, nápady, programování. Dříve dum-zahrada, finance, internet a know-how.okhelp.cz Pro lepší výsledky hledání používejte i diakritiku.

IllegalArgumentException Unknown Uri content SearchableDict


AD MOB

If you change the package name, you have to add new package name in:

DictionaryProvider.java


public class DictionaryProvider extends ContentProvider {
    String TAG = "DictionaryProvider";

//    public static String AUTHORITY = "com.example.android.searchabledict.DictionaryProvider";
// change to your new package name
public static String AUTHORITY = "com.myweb.mysubdomen.searchabledict.DictionaryProvider";
    public static final Uri CONTENT_URI = Uri.parse("content://" + AUTHORITY + "/dictionary");


// in AndroidManifest.xml
//change com.example.android to your package e.g. com.myweb.mysubdomen
<!-- Provides search suggestions for words and their definitions. -->
        <provider android:name="com.example.android.searchabledict.DictionaryProvider"
            android:configChanges="keyboard|keyboardHidden|orientation"
                  android:authorities="com.example.android.searchabledict.DictionaryProvider" />

        <!-- Points to searchable activity so the whole app can invoke search. -->
        <meta-data android:name="android.app.default_searchable"
            android:configChanges="keyboard|keyboardHidden|orientation"
                   android:value=".SearchableDictionary" />

// I change like this:
        <!-- Provides search suggestions for words and their definitions. -->
        <provider android:name=".DictionaryProvider"
            android:configChanges="keyboard|keyboardHidden|orientation"
                  android:authorities="cz.okhelp.android.searchabledict.DictionaryProvider" />

        <!-- Points to searchable activity so the whole app can invoke search. -->
        <meta-data android:name="android.app.default_searchable"
            android:configChanges="keyboard|keyboardHidden|orientation"
                   android:value=".SearchableDictionary" />


Do not forget change package name in all java class and xml/searchable.xml
In my project I changed like this:

<searchable xmlns:android="//schemas.android.com/apk/res/android"
        android:label="@string/search_label"
        android:hint="@string/search_hint"
        android:searchSettingsDescription="@string/settings_description"
        android:searchSuggestAuthority="cz.okhelp.android.searchabledict.DictionaryProvider"
        android:searchSuggestIntentAction="android.intent.action.VIEW"
        android:searchSuggestIntentData="content://cz.okhelp.android.searchabledict.DictionaryProvider/dictionary"
        android:searchSuggestSelection=" ?"
        android:searchSuggestThreshold="1"
        android:includeInGlobalSearch="true"
        >
 </searchable>



397LW NO topic_id




AD

Další témata ....(Topics)


390

Android runtime change switch Activity theme | android-runtime-change-switch-activity-theme



static boolean mbThemeLight = false;

 @Override
    public void onCreate(Bundle savedInstanceState) {
         if(mbThemeLight)
        setTheme(android.R.style.Theme_Light);
        super.onCreate(savedInstanceState);
        // bla bla bla..........
    }

private void switchTheme(){
 mbThemeLight = true;
 this.recreate();
}
262

Font Family change on View dynamically Android Example | font-family-change-on-view-android-example


TypeFace, setTypeface, font, font family, array of String, Button create dynamically

@Override
protected void onStart() {
LinearLayout.LayoutParams p = new LinearLayout.LayoutParams(
  48,
  55
);	
Typeface typeFace = Typeface.MONOSPACE;	
String [] ar = {"A","B","C","D","E","F","G","H","J","K"};
for (int i = 0; i < ar.length; i++) {
Button buttonView = new Button(this);
buttonView.setText(Html.fromHtml("<b>"+ar[i]+"</b>"));
buttonView.setTextColor(Color.BLUE);
buttonView.setTextSize(27.f);
buttonView.setTypeface(typeFace,Typeface.BOLD);
buttonView.setOnClickListener(mThisButtonListener);
if(i%2==0)
	mLayoutButtons.addView(buttonView, p);
else
	mLayoutButtonsNextRow.addView(buttonView, p);
	
_listOfButtons.add(buttonView);
}

	super.onStart();
}

//////// xml file
<TextView
    android:id="@+id/text01"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:textSize="20dp"
    android:fontFamily="Arial"
 />
246

Set Custom Font to View Android Example | set-custom-font-to-view-android-example


You have to put your font fonts/samplefont.ttf into assets/fonts folder in your project!

// set own custom font from assets
TextView txt = (TextView) findViewById(R.id.custom_font);
Typeface mFace = Typeface.createFromAsset(getContext().getAssets(),
                                             "fonts/samplefont.ttf");
    txt.setTypeface(mFace);
325

How to create mobile friendly page | how-to-create-mobile-friendly-page


If using Wordpress:
- update Wordpress
- download Plugin Any Mobile Theme Switcher and upzip into yourweb/wp-content/plugins/
- open Wordpress Dachboard on yourweb
- set defalut theme for desktop (Appearance - Theme)
- set themes for mobile users Settings - Any Mobile Theme Switcher for example Twentyfourteen theme
- preview page
- test page on Mobile Friendly Test
233

ACRA allows your Android application to send Crash Reports | acra-allows-your-android-application-to-send-crash-reports


ACRA allows your Android application to send Crash Reports to various destinations:

a Google Docs spreadsheet (default and original behavior)
an email
your own server-side HTTP POST script
any other possible destination by implementing your own report sender

ACRA wiki and download page of project library


Editace: 2015-11-06 13:18:38
Počet článků v kategorii: 397
Url:illegalargumentexception-unknown-uri-content-searchabledict

AD
11 Share
Share
Tweet