我正在尝试构建一个.rpm包.我刚刚按照步骤来做到这一点.到现在为止所有的步骤都很顺利,但现在我只是坚持这一步.我只是运行以下命令并得到此错误:
rpmbuild -ba asterisk.spec
error: Failed build dependencies:
gtk2-devel is needed by asterisk-1.8.12.2-1.fc15.x86_64
libsrtp-devel is needed by asterisk-1.8.12.2-1.fc15.x86_64
[... more ...]
freetds-devel is needed by asterisk-1.8.12.2-1.fc15.x86_64
uw-imap-devel is needed by asterisk-1.8.12.2-1.fc15.x86_64
Run Code Online (Sandbox Code Playgroud)
我正在使用fedora-15.如何解决此错误?
如何在安装src.rpm包时安装所有依赖项.可能吗?
我正在尝试更新SharedPreferences的值,这是我的代码:
edit = PreferenceManager.getDefaultSharedPreferences(this).edit();
edit.putString(Settings.PREF_USERNAME+"",txtuser);
edit.putString(Settings.PREF_PASSWORD+"",txtpass);
edit.commit();"
Run Code Online (Sandbox Code Playgroud)
问题是当我访问这个值时,它没有返回更新的值,它给了我一个SharedPreferences的值.
但是当我在XML文件中确认数据时,数据就更新了.
重新启动我的应用程序后,我得到了更新的值.所以它需要我重新启动应用程序以获取更新的值.
那么,一旦它发生变化,如何获得这些更新的值?
提前致谢
这是我的整个代码:
@Override
public void onCreate(Bundle icicle) {
super.onCreate(icicle);
setContentView(R.layout.main);
ctx=this;
status=PreferenceManager.getDefaultSharedPreferences(this).getString(Settings.PREF_STATUS, Settings.DEFAULT_STATUS);// get old value
submit.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
on(ctx,true);// function will call and value is updated
}
}});
status=PreferenceManager.getDefaultSharedPreferences(this).getString(Settings.PREF_STATUS, Settings.DEFAULT_STATUS);// this should give me a updated value but gives old value
}
public static boolean on(Context context) {
return PreferenceManager.getDefaultSharedPreferences(context).getBoolean(Settings.PREF_ON, Settings.DEFAULT_ON);
}
public static void on(Context context,boolean on) …Run Code Online (Sandbox Code Playgroud) 我正在开发我想要使用VPN网络的应用程序.要在设备中创建VPN网络,我们需要从设备的(设置 - 无线和网络 - VPN设置)菜单进行配置.
我想通过带有硬编码信息的代码进行这么多设置.
从API级别4.0开始,android提供API来处理VPN服务.
要知道这个方法的实现,我使用了Android ToyVPN的Sample项目.但在这许多方法中,我没有找到任何方法来传递用户名和密码.我必须连接VPN网络的信息是.
使用这三个信息,如果我从设备手动配置,我就成功连接到VPN网络.但我想以编程方式执行此操作.这是用于连接VPN网络的类文件. ToyVpnClient.java和ToyVpnService.java.除此示例应用程序外,还会在设备中崩溃.
任何帮助将不胜感激.
我正在开发应用程序,我想在按钮点击关闭整个应用程序.我知道在android中我们不应该考虑关闭应用程序,因为android会自动执行此操作退出应用程序不满意吗?.但我想关闭我的申请.
所以我正在做什么来关闭应用程序是我使用Intent.FLAG_ACTIVITY_CLEAR_TOP标志来删除活动堆栈.
Intent intent = new Intent(Activity3.this, FinishActivity.class);
intent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
startActivity(intent);
finish();
Run Code Online (Sandbox Code Playgroud)
在FinishActivity.class我打电话的onCreate,this.finish()但应用程序没有关闭,之前的活动重新打开.
FinishActivity.class
@Override
protected void onCreate(Bundle savedInstanceState) {
// TODO Auto-generated method stub
super.onCreate(savedInstanceState);
this.finish();
}
Run Code Online (Sandbox Code Playgroud)
更新:
这是场景
MainActivity->Activity2->Activity3->FinishActivity
Run Code Online (Sandbox Code Playgroud)
这Activity2是在完成活动后打开的.
我如何实现这一目标?任何想法和建议将不胜感激.
感谢和问候
我正在开发一个应用程序,我想在其中显示时间选择器以设置提醒时间.现在我能够使用这样的偏好屏幕显示时间选择器
<org.example.android.TimePreference
android:defaultValue="12:00"
android:key="check_time"
android:summary="Set your desired time for check"
android:title="Check time" />
Run Code Online (Sandbox Code Playgroud)
TimePreference.java文件是从PreferenceScreen链接中的此TimePicker继承的.但我想在按钮单击特定活动时显示此信息并在其中EditText或中设置值TextView.我不想使用偏好.
所以,我想让这个屏幕的布局如下图所示.

任何想法和建议将不胜感激和
感谢
我在AsynkTask中编写了网络操作代码时得到了android.os.NetworkOnMainThreadException.抛出这个例外有什么其他原因吗?
这是我的代码:
public class Background_confirmation extends AsyncTask<Void, Integer, Void> {
@Override
protected void onPreExecute() {
// TODO Auto-generated method stub
progressDialog = ProgressDialog.show(Confirmation.this,
"Please wait...", "Retrieving data ...", true);
try {
HttpClient httpclient = new DefaultHttpClient();
HttpPost httppost = new HttpPost(
"http://68.121.167.160/sip_chat_api/create_account.php?useralias="
+ useralias + "&cntname=" + cntcode + "");
HttpResponse response = httpclient.execute(httppost);
HttpEntity entity = response.getEntity();
is = entity.getContent();
} catch (Exception e) {
e.printStackTrace();
}
if (backgroung_flag == 1) {
} else {
if (is != null) …Run Code Online (Sandbox Code Playgroud) 我安装了一个默认开箱即用的FreeSwitch实例,但是当我尝试拨打内线电话(扩展到分机)时,它需要大约12秒才能建立呼叫,我可以听到铃声.
当我查看日志时,我几乎立即看到了连接请求但没有活动,10秒或更长时间后呼叫开始,我听到电话响了.
这是它有用的日志文件,请看130:08:07到13:08:17之间的10秒延迟.
freeswitch@vps-1170411-23979.manage.myhosting.com> 2015-09-26 13:07:41.591949 [CONSOLE] mod_voicemail.c:4091 Event Thread Started
2015-09-26 13:08:02.171949 [NOTICE] switch_channel.c:1075 New Channel sofia/internal/1001@168.144.85.16 [25229804-6471-11e5-9558-f1a7477c5309]
2015-09-26 13:08:07.331948 [INFO] mod_dialplan_xml.c:635 Processing BSmarter.CA <1001>->1000 in context default
2015-09-26 13:08:07.331948 [CRIT] mod_dptools.c:1670 WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING
2015-09-26 13:08:07.331948 [CRIT] mod_dptools.c:1670 Open /usr/local/freeswitch/conf/vars.xml and change the default_password.
2015-09-26 13:08:07.331948 [CRIT] mod_dptools.c:1670 Once changed type 'reloadxml' at the console.
2015-09-26 13:08:07.331948 [CRIT] mod_dptools.c:1670 WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING
2015-09-26 13:08:17.371961 [INFO] switch_ivr_async.c:3932 …Run Code Online (Sandbox Code Playgroud) 我正在开发一个聊天应用程序,我想创建一个聊天屏幕布局,如下面的屏幕.

目前我正在使用ListView作为我的聊天文本,但问题是要阅读我必须向下滚动的长聊,我的屏幕不会自动滚动.
我想要这个泡泡类的聊天布局.如何开发这种聊天布局?
我正在开发Android应用程序,因为我正在开发NDK.在编译文件时,我得到了所选处理器的错误,不支持`qadd16 r1,r1,r0'.任何人都可以解释我为什么以及在哪里出现此错误以及如何处理此错误?这是我的basic_op.h文件的代码片段
static inline Word32 L_add(register Word32 ra, register Word32 rb)
{
Word32 out;
__asm__("qadd %0, %1, %2"
: "=r"(out)
: "r"(ra), "r"(rb));
return (out);
}
Run Code Online (Sandbox Code Playgroud)
提前致谢
我正在开发一个应用程序,我想在其中添加可以从左到右,从右到左滑动的图像,如下图所示.内部白色游戏图像应该从左到右移动,反之亦然.

到目前为止我所做的是,我能够从左到右移动单个图像,反之亦然,但我想要设置背景图像以及上面圆形黑色背景.
这是我的代码:
imageView.setOnTouchListener(new OnTouchListener() {
public boolean onTouch(View v, MotionEvent event) {
// TODO Auto-generated method stub
int eid = event.getAction();
switch (eid) {
case MotionEvent.ACTION_MOVE:
RelativeLayout.LayoutParams mParams = (RelativeLayout.LayoutParams) imageView.getLayoutParams();
int x = (int) event.getRawX();
mParams.leftMargin = x - 50;
imageView.setLayoutParams(mParams);
break;
default:
break;
}
return true;
}
});
Run Code Online (Sandbox Code Playgroud)
编辑
我尝试通过设置我的布局xml来管理背景图像,如下所示:
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent" >
<RelativeLayout
android:layout_width="250dp"
android:layout_height="wrap_content"
android:layout_alignParentTop="true"
android:layout_centerHorizontal="true"
android:layout_marginTop="49dp"
android:background="@drawable/set_user_profile_back"
android:paddingLeft="10dp"
android:paddingRight="10dp" >
<ImageView
android:id="@+id/imageView1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:contentDescription="@string/hello_world"
android:src="@drawable/next" />
</RelativeLayout>
</RelativeLayout>
Run Code Online (Sandbox Code Playgroud)
但是现在我面临图像尺寸问题,图像尺寸减小,如何解决这个问题以及如何修复图像移动的起点和终点.

任何想法和建议都将被适用
我在使用Perl时遇到了一些问题.在执行期间,我收到此错误.
Can't locate XML/LibXML/NodeList.pm in @INC (@INC contains: /usr/local/lib64/perl5 /usr/local/share/perl5 /usr/lib64/perl5/vendor_perl /usr/share/perl5/vendor_perl /usr/lib64/perl5 /usr/share/perl5 .) at /usr/local/lib64/perl5/XML/LibXML.pm line 25.
Run Code Online (Sandbox Code Playgroud)
但当我尝试使用locate命令找到此文件时,我发现它.
/usr/local/lib/perl5/site_perl/5.18.0/x86_64-linux/XML/LibXML/目录.
我已经安装了不同的perl软件包,它们都安装正确.如果我将单个文件放在指定的位置,那么它会抱怨另一个文件.所以手动放置文件不是一个好主意.
那么我如何改变它的路径,以便它可以从正确的目录执行文件?
编辑
Can't locate loadable object for module XML::LibXML in @INC (@INC contains: /usr/local/lib64/perl5 /usr/local/share/perl5 /usr/lib64/perl5/vendor_perl /usr/share/perl5/vendor_perl /usr/lib64/perl5 /usr/share/perl5 .) at /usr/local/lib64/perl5/XML/LibXML.pm line 154
[Wed Jul 03 10:15:13 2013] [error] [client 192.73.242.136] BEGIN failed--compilation aborted at /usr/local/lib64/perl5/XML/LibXML.pm line 154.
[Wed Jul 03 10:15:13 2013] [error] [client 192.73.242.136] Compilation failed in require at /var/www/cgi-bin/astpp/astpp-cdr-xml.cgi line 23. …Run Code Online (Sandbox Code Playgroud) 在AlertDialog中,我可以设置Message的大小,但是当我为Title执行相同操作时,它会崩溃.
码:
AlertDialog dialog = new AlertDialog.Builder(this).setMessage(message).setTitle(title)
.setPositiveButton(android.R.string.ok, new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int id) {
dialog.cancel();
}
}).show();
TextView titleTxt= (TextView)dialog.findViewById(android.R.id.title);
**titleTxt.setTextSize(TypedValue.COMPLEX_UNIT_SP, 40);** // crash here
TextView textView = (TextView) dialog.findViewById(android.R.id.message);
**textView.setTextSize(40);** // works fine
Button btn1 = dialog.getButton(DialogInterface.BUTTON_POSITIVE);
btn1.setTextSize(36);
Run Code Online (Sandbox Code Playgroud)
我的输出:
05-10 11:49:56.917: E/AndroidRuntime(8376): FATAL EXCEPTION: main
05-10 11:49:56.917: E/AndroidRuntime(8376): java.lang.NullPointerException
05-10 11:49:56.917: E/AndroidRuntime(8376): at com.binary.taxitop.LoginScreen.showAlertDialog(LoginScreen.java:116)
05-10 11:49:56.917: E/AndroidRuntime(8376): at com.binary.taxitop.LoginScreen.VerifyCredentialsAndEnterNextScreen(LoginScreen.java:103)
05-10 11:49:56.917: E/AndroidRuntime(8376): at com.binary.taxitop.LoginScreen.onClick(LoginScreen.java:84)
05-10 11:49:56.917: E/AndroidRuntime(8376): at android.view.View.performClick(View.java:3511)
05-10 11:49:56.917: E/AndroidRuntime(8376): at android.view.View$PerformClick.run(View.java:14109)
05-10 …Run Code Online (Sandbox Code Playgroud)