R.string to string R.array to array Android
R.string to string Android source code
R.array to string [] Android source code
R.array to string [] Android source code
String s = getResources().getString(R.string.my_string); // Hello world!!
String[] arrayOfStrings = getResources().getStringArray(R.array.my_array); // one, two
<xml version="1.0" encoding="utf-8">
<resources>
<string-array name="my_array">
<item>one</item>
<item>two</item>
</string-array>
<string name="my_string">Hello world!!</string>
</resources>
396LW NO topic_id
AD
Další témata ....(Topics)
import android.os.Build.VERSION;
//
int nSdkVersion = Integer.parseInt(Build.VERSION.SDK);
int nApiVersion = VERSION.SDK;
Platform Version | API Level |
---|---|
Android 4.0 | 14 |
Android 3.2 | 13 |
Android 3.1.x | 12 |
Android 3.0.x | 11 |
Android 2.3.4 | 10 |
Android 2.3.3 | 10 |
Android 2.3.2 | 9 |
Android 2.3.1 | 9 |
Android 2.3 | 9 |
Android 2.2.x | 8 |
Android 2.1.x | 7 |
Android 2.0.1 | 6 |
Android 2.0 | 5 |
Android 1.6 | 4 |
Android 1.5 | 3 |
Android 1.1 | 2 |
Android 1.0 | 1 |
If you using Context as parameter of function try this solution:
public class MyActivity extends Activity {
// bla bla bla .......
//error
myFc( getapplicationcontext());
// OK
myFc(MyActivity.this);
// 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/";
}
FrameLayou, fragment have to unique id android:id="@+id/your_id_unique"
<FrameLayout xmlns:android="//schemas.android.com/apk/res/android"
xmlns:tools="//schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent" >
<fragment
android:id="@+id/your_id_unique"
android:layout_width="match_parent"
android:layout_height="match_parent"
class="cz.okhelp.notepad.AddNoteFragment"
tools:layout="@layout/add_note" />
</FrameLayout>
To hide a module File->Project Structure Ctrl+Alt+Shift+S
In left panel click on Module which want to hide.
Click on minus symbol (-) on upper left corner of window.
Click Yes.
To delete module from disk click on module in project tree (to select) and press Delete on keyboard.
In left panel click on Module which want to hide.
Click on minus symbol (-) on upper left corner of window.
Click Yes.
To delete module from disk click on module in project tree (to select) and press Delete on keyboard.
Editace: 2013-12-09 11:03:12
Počet článků v kategorii: 396
Url:r-string-to-string-r-array-to-array-android