小编pen*_*ree的帖子

Android开发:无法创建图标@ drawable/ic_action_search

我是Android开发的新手.我只是按照基本的创作developer.android.com来创建我的第一个应用程序.

当我创建Action BAr时,我不得不将此搜索按钮添加到它.我创建了菜单xml,这就是我写的.

<!-- Search, should appear as action button -->
<item android:id="@+id/action_search"
      android:icon="@drawable/ic_action_search"
      android:title="@string/action_search"
      android:showAsAction="ifRoom" />
<!-- Settings, should always be in the overflow -->
<item android:id="@+id/action_settings"
      android:title="@string/action_settings"
      android:showAsAction="never" />
Run Code Online (Sandbox Code Playgroud)

现在我的问题是关于XML的这一部分

android:icon="@drawable/ic_action_search"
Run Code Online (Sandbox Code Playgroud)

我在eclipse中遇到编译错误,其中说,

错误:错误:找不到与给定名称匹配的资源(在'icon'处,值为'@ drawable/ic_action_search').

我检查了developer.android.com并且也搜索了它,但我无法找到解决方案.

我需要解决这个问题.和往常一样,我可以跳过XML的这一部分,我得到的只是纯文本"SEARCH",但图标肯定会更好看.

android drawable

27
推荐指数
5
解决办法
4万
查看次数

选择查询的PHP mySQL错误

很少有人在一开始就遇到同样的问题,但是,我正在重复这个问题,因为我似乎特定于EMail ID.

我有一个查询,在给定特定电子邮件ID作为输入的情况下检索密码.这是我的疑问

Select Password from userauth where user_name in (select id from users where email = 's.sriram@example.com')
Run Code Online (Sandbox Code Playgroud)

从phpMyAdmin完成此查询时没有任何问题.

但是,当我通过php脚本执行此操作时,它不起作用.那个php脚本如下:

<?php

// Grab User submitted information
$email = $_POST["users_email"];
$pass = $_POST["users_pass"];

// Connect to the database
$con= mysql_connect("localhost","root","sriram123");
// Check connection
if (mysqli_connect_errno())
{
    echo "Failed to connect to MySQL: " . mysqli_connect_error();
}
// Select the database to use
mysql_select_db("mydb",$con);

echo "Select Password from userauth where user_name in (select id from users where email = '$email')";

$result = …
Run Code Online (Sandbox Code Playgroud)

php mysql

0
推荐指数
1
解决办法
2134
查看次数

标签 统计

android ×1

drawable ×1

mysql ×1

php ×1