No USB devices or running detected
Check
- is sett debug mode on device?
- enabled debugging over USB?
- is device right connected?
- have you downloaded and instaled drivers for your device on PC?
- For Windows //developer.android.com/sdk/win-usb.html
- try disconnect and connect USB cable
- try do restart Android Studio
396LW NO topic_id
AD
Další témata ....(Topics)
Calendar cal = new GregorianCalendar(), int year = cal.get(Calendar.YEAR),
ERA, MONTH, DAY_OF_MONTH, DAY_OF_WEEK, Android example code.
ERA, MONTH, DAY_OF_MONTH, DAY_OF_WEEK, Android example code.
public class MainActivity extends Activity {
TextView txtV;
Context cntx;
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
txtV = (TextView)findViewById(R.id.idLabel);
cntx = this;
Calendar cal = new GregorianCalendar();
int era = cal.get(Calendar.ERA); // 0 B.C. before Christ, 1 Anno Domini
txtV.setText(txtV.getText() +"
" + era);
int year = cal.get(Calendar.YEAR); // 2011
txtV.setText(txtV.getText() +"
" + year);
int month = cal.get(Calendar.MONTH); // 0 is Januar
txtV.setText(txtV.getText() +"
" + month);
int day = cal.get(Calendar.DAY_OF_MONTH); // 1 to 31
txtV.setText(txtV.getText() +"
" + day);
int dayOfWeek = cal.get(Calendar.DAY_OF_WEEK); // 1=Sunday, 2=Monday ...
txtV.setText(txtV.getText() +"
" + dayOfWeek);
}
}
Errors:
E/Ads(333): The android:configChanges value of the com.google.ads.AdActivity must include screenLayout.
E/Ads(333): The android:configChanges value of the com.google.ads.AdActivity must include uiMode.
E/Ads(333): The android:configChanges value of the com.google.ads.AdActivity must include screenSize.
E/Ads(333): The android:configChanges value of the com.google.ads.AdActivity must include smallestScreenSize.
E/Ads(333): You must have AdActivity declared in AndroidManifest.xml with configChanges.
Solution:
Try to using a lower version of the GoogleAdMobAdsSDK ADS SDK in project:
GoogleAdMobAdsSDK-4.0.4
How add SDK to project
Add activity to AndroidManifest.xml
E/Ads(333): The android:configChanges value of the com.google.ads.AdActivity must include screenLayout.
E/Ads(333): The android:configChanges value of the com.google.ads.AdActivity must include uiMode.
E/Ads(333): The android:configChanges value of the com.google.ads.AdActivity must include screenSize.
E/Ads(333): The android:configChanges value of the com.google.ads.AdActivity must include smallestScreenSize.
E/Ads(333): You must have AdActivity declared in AndroidManifest.xml with configChanges.
Solution:
Try to using a lower version of the GoogleAdMobAdsSDK ADS SDK in project:
GoogleAdMobAdsSDK-4.0.4
How add SDK to project
Add activity to AndroidManifest.xml
// .............. blah
<uses-sdk android:minSdkVersion="4"/>
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<application android:icon="@drawable/dicts_ico" android:label="@string/app_name"
>
<meta-data
android:value="a12345_your_number"
android:name="ADMOB_PUBLISHER_ID" />
<activity android:name=".MainStartMenu"
android:label="@string/app_name"
android:configChanges="keyboardHidden|orientation"
>
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<!-- Google ads -->
<activity android:name="com.google.ads.AdActivity"
android:configChanges="keyboard|keyboardHidden|orientation"/>
// ......... blah
Show keyboard if WebView input have focus Android apps development example source code.
WebView webview;
//in onCreate
webview = (WebView) findViewById(R.id.idWebviewPda);
webview.getSettings().setJavaScriptEnabled(true);
webview.loadUrl("//android.okhelp.cz");
webview.requestFocus(View.FOCUS_DOWN);
webview.setOnTouchListener(new View.OnTouchListener() {
@Override
public boolean onTouch(View v, MotionEvent event) {
switch (event.getAction()) {
case MotionEvent.ACTION_DOWN:
case MotionEvent.ACTION_UP:
if (!v.hasFocus()) {
v.requestFocus();
}
break;
}
return false;
}
});
RadioButton RadioGroup Android example source code for Android developer
Example for *.xml files
Example for *.java files
Example for *.xml files
<RadioGroup android:id="@+id/idRadio_group"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="20dp"
android:orientation="vertical">
<RadioButton android:id="@+id/idRadio_1"
android:text="@string/textLabel_1"/>
<RadioButton android:id="@+id/idRadio_2"
android:text="@string/textLabel_2"/>
<RadioButton android:id="@+id/idRadio_3"
android:text="@string/textLabel_3"/>
</RadioGroup>
Example for *.java files
// import
import android.widget.RadioGroup;
// get handle of RadioGroup
RadioGroup mRadioGroup = (RadioGroup) findViewById(R.id.idRadio_group);
// which RadioButton is selected for example in some function body
int nUnits = 10; // decimetry
int nIdRadio = mRadioGroup.getCheckedRadioButtonId();
if(nIdRadio == R.id.idRadio_1) nUnits = 1; // metr
else if(nIdRadio == R.id.idRadio_2) nUnits = 10; // decimetr
else if(nIdRadio == R.id.idRadio_3) nUnits = 100; // cm
else if(nIdRadio == R.id.idRadio_4) nUnits = 1000; // mm
// listener for RadioGroup Java Android example
mRadioGroup.setOnCheckedChangeListener(
new RadioGroup.OnCheckedChangeListener() {
public void onCheckedChanged(RadioGroup group,
int checkedId) {
Log.v("Selected", "New radio item selected: " + checkedId);
recordNewUIState();
}
});
Tutorial by pictures how evaluate a variable in Eclipse debugger window.
1.) Open Debug perspective in Eclipse and to start debugging a Activity.
2.) Open Display window from menu Window->Show view->Display
3.) Set breakpoint where you need to evaluate a variable.
4.) Debug the Activity to breakpoint.
5.) Into the Display window type code for evaluate your variable and execute code.
6.) Check if change of value a variable
1.) Open Debug perspective in Eclipse and to start debugging a Activity.
2.) Open Display window from menu Window->Show view->Display
3.) Set breakpoint where you need to evaluate a variable.
4.) Debug the Activity to breakpoint.
5.) Into the Display window type code for evaluate your variable and execute code.
6.) Check if change of value a variable
Editace: 2016-02-29 16:53:45
Počet článků v kategorii: 396
Url:no-usb-devices-or-running-detected