Android Studio lock unlock file make read only or writable
Select file in project explorer
Menu:
File - Make File Read-only - to lock
File - Make File Writable - to unlock
Menu:
File - Make File Read-only - to lock
File - Make File Writable - to unlock
396LW NO topic_id
AD
Další témata ....(Topics)
Warning in AndroidManifest.xml:
tag should specify a target API level (the highest verified version; when running on
later versions, compatibility behaviors may be enabled) with android:targetSdkVersion="?"
Solution:
later versions, compatibility behaviors may be enabled) with android:targetSdkVersion="?"
Solution:
<uses-sdk android:minSdkVersion="4"
android:targetSdkVersion="16" />
If you want download some *.apk file from internet and try on your emulator you get error than you have to install SD card. You have to closing Android emulator.
Mount Android emulator SD card instruction
Image how install SD card on Android emulator in Eclipse.
Mount Android emulator SD card instruction
- In Eclipse go in menu Window - Android SDK and Avg Manager
- Select Virtual devices
- Select AVD Name where you need install SD card
- Click on Edit button
- In open dialog go to SD card - Size: and write 500
- Press button Edit AVD
- Run AVD emulator
Image how install SD card on Android emulator in Eclipse.
Update TextView by runnable. Handler, runnable, timer Android example.
main.xml
public class TimerActivity extends Activity {
TextView hTextView;
Button hButton, hButtonStop;
private Handler mHandler = new Handler();
private int nCounter = 0;
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
hTextView = (TextView)findViewById(R.id.idTextView);
hButton = (Button)findViewById(R.id.idButton);
hButton.setOnClickListener(mButtonStartListener);
hButtonStop = (Button)findViewById(R.id.idButtonStop);
hButtonStop.setOnClickListener(mButtonStopListener);
} // end onCreate
View.OnClickListener mButtonStartListener = new OnClickListener() {
public void onClick(View v) {
try {
mHandler.removeCallbacks(hMyTimeTask);
// Parameters
// r The Runnable that will be executed.
// delayMillis The delay (in milliseconds) until the Runnable will be executed.
mHandler.postDelayed(hMyTimeTask, 1000); // delay 1 second
} catch (Exception e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
};
private Runnable hMyTimeTask = new Runnable() {
public void run() {
nCounter++;
hTextView.setText("Hallo from thread counter: " + nCounter);
}
};
/**
*
*/
View.OnClickListener mButtonStopListener = new OnClickListener() {
public void onClick(View v) {
mHandler.removeCallbacks(hMyTimeTask);
}
};
}
main.xml
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="//schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
>
<TextView
android:id="@+id/idTextView"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="@string/hello"
/>
<Button android:text="Button"
android:id="@+id/idButton"
android:layout_width="wrap_content"
android:layout_height="wrap_content"></Button>
<Button android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/idButtonStop"
android:text="Stop"></Button>
</LinearLayout>
Try this solutions:
1.) Save xml file
2.) Close tab with xml file
3.) Reopen xml file
1.) Open from menu Window->Android SDK Manager
2.) Select available updates (Tools, SDK etc.)
3.) Install updates
1.) Open from menu Help->Check for Updates
2.) Install available plugins what You need
3.) Restart Eclipse
1.) Save xml file
2.) Close tab with xml file
3.) Reopen xml file
1.) Open from menu Window->Android SDK Manager
2.) Select available updates (Tools, SDK etc.)
3.) Install updates
1.) Open from menu Help->Check for Updates
2.) Install available plugins what You need
3.) Restart Eclipse
If you often copy your Android project to another you have to using function for obtaining varied information about package.
This code show how get package name in Android application as string:
This code show how get package name in Android application as string:
Context context = getContext(); // this.getContext(); getApplicationContext(); etc.
String sPackName = context.getPackageName();
Editace: 2015-12-04 19:50:55
Počet článků v kategorii: 396
Url:android-studio-lock-unlock-file-make-read-only-or-writable