我一直在阅读一个教程,该教程解释了如何使用具有不同状态的按钮的背景但它似乎不起作用:S
这是我的代码:
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:drawable="@drawable/boutonn" android:state_window_focused="false"/>
<item android:drawable="@drawable/boutonnpousse" android:state_pressed="true"/>
<item android:drawable="@drawable/boutonnpousse" android:state_focused="true"/>
<item android:drawable="@drawable/boutonn" android:state_focused="false"
android:state_pressed="false" />
</selector>
Run Code Online (Sandbox Code Playgroud)
这是我放在我的drawable文件夹中的xml代码,这里是使用这些按钮的活动的xml的一部分:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@drawable/backgrounddd"
android:orientation="vertical" >
<Button
android:id="@+id/bNoteRemind"
android:layout_width="100dp"
android:layout_height="100dp"
android:layout_gravity="center"
android:background="@drawable/imagebutton1" />
...
Run Code Online (Sandbox Code Playgroud)
这是java类:
public class MenuPrincipal extends Activity {
Button NoteRemind;
@Override
protected void onCreate(Bundle savedInstanceState) {
// TODO Auto-generated method stub
super.onCreate(savedInstanceState);
//on lui associe le layout menuprincipal.xml
setContentView(R.layout.menuprincipal);
NoteRemind = (Button) findViewById(R.id.bNoteRemind);
// Si on choisit de rédiger une …Run Code Online (Sandbox Code Playgroud) 我试图从android活动连接到数据库到我的sqldatabase进行注册页面,我收到此错误"org.json.JSONException:Value
首先,任何人都可以告诉我如何使用带有PHP脚本的mysql数据库为Android应用程序调试我的程序?因为我通常使用日志猫,但这里的错误不是很清楚:S ......
这是活动代码:
public class Subscribe extends Activity {
Button bSubscribe;
EditText etPwdSub, etPwdConf, etLoginSub, etNameSub, etFnSub;
String result = null;
InputStream is = null;
String donnees = "";
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.subscribe);
etLoginSub = (EditText) findViewById(R.id.etLoginSub);
etPwdSub = (EditText) findViewById(R.id.etPwdSub);
etPwdConf = (EditText) findViewById(R.id.etPwdConf);
etNameSub = (EditText) findViewById(R.id.etNameSub);
etFnSub = (EditText) findViewById(R.id.etFnSub);
bSubscribe = (Button) findViewById(R.id.bSubscribe);
bSubscribe.setOnClickListener(new View.OnClickListener() {
public void onClick(View v) {
Pattern p = Pattern.compile(".+@.+\\.[a-z]+");
Matcher m = p.matcher(etLoginSub.getEditableText());
if (m.matches() == …Run Code Online (Sandbox Code Playgroud) 为了响应网页设计的目的,我想在这个伪代码中使用PHP条件:
if(small_screen_resolution){
<small div>
My content
</small div>
else{
<div>
My content
</div>
}
Run Code Online (Sandbox Code Playgroud)
我只是想知道谷歌机器人如何考虑"我的内容",因为它在我的代码中出现了两次,谷歌是否认为它像一个重复的内容(这对SEO不好)?
谢谢 !