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.

Links too close together Mobile friendly page


AD MOB

Try set bigger line-height of links and font size for example:


/*in css*/
.links{
line-height: 48px;
font-size: 20px;
background-color: rgb(255,204,0);
}

/* in html page set class of link*/
<a class="links" href="m.mydomen.com/mypage.html">Blah blah mypage</a>

// or in css for all links on page
a {
line-height: 48px;
font-size: 20px;
}

/*html page*/
<a href="m.mydomen.com/mypage.html">Blah blah mypage</a>


397LW NO topic_id




AD

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


300

Do not hardcode /data/ use Context.getFilesDir().getPath() | do-not-hardcode-data-use-context-getfilesdir-getpath



// warning
private static String DB_PATH =  "/data/data/cz.okhelp.german_czech_phrases/databases/";

// OK
   public DataBaseHelper(Context context) {	 
    	super(context, DB_NAME, null, 1);
        this.myContext = context;
        // OK
         DB_PATH = context.getFilesDir().getParentFile().getPath()
              + "/databases/";
    }
212

Accessibility Missing contentDescription attribute on image | accessibility-missing-contentdescription-attribute-on-image


Android Emulator warning:[Accessibility] Missing contentDescription attribute on image

Workaround example code:
android:contentDescription="@string/desc"

            <ImageView
                android:id="@+id/imageViewOil"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
            android:contentDescription="@string/desc"
                android:layout_alignParentLeft="true"
                android:layout_centerVertical="true"
                android:layout_marginLeft="84dp"
                android:src="@drawable/tank_silver" />
383

EditText hint not show | edittext-hint-not-show


Try this solution - into xml file add row to EditText tag:


android:textColorHint="@color/grey"

367

View getId is null Android | view-getid-is-null-android


If you create a button or view programmatically with OnClickListener you can set a tag key before button in parent layout is added.
And get correct button by this tag getTag() instead getId() in OnClickListener etc.

Button button = new Button(getApplicationContext());
int idOfButton = button.getId(); // return -1

button.setTag("my_button");
String sTag = (String) button.getTag(); // return "my_button"

51

Get assets folder files to array of strings Android example | get-assets-folder-files-to-array-of-strings-android-example


Get assets folder files to array of strings.
Its show files in assets folder and sub folders:


    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.main);
        
        final AssetManager assetManager = getAssets();
        try {
			// for assets folder add empty string
                        String[] filelist = assetManager.list("");
                        // for assets/subFolderInAssets add only subfolder name
                        String[] filelistInSubfolder = assetManager.list("subFolderInAssets");
			if (filelist == null) {
			    // dir does not exist or is not a directory
			} else {
			    for (int i=0; i<filelist.length; i++) {
			        // Get filename of file or directory
			        String filename = filelist[i];
			    }
			}
                     
                        // if(filelistInSubfolder == null) ............  

		} catch (IOException e) {
			e.printStackTrace();
		}
     }




Editace: 2015-05-28 19:07:29
Počet článků v kategorii: 397
Url:links-too-close-together-mobile-friendly-page

AD
11 Share
Share
Tweet