小编Sri*_*ari的帖子

如何检查Android中的radiogroup中是否检查了radiobutton?

我需要设置验证,用户必须填写/选择页面中的所有详细信息.如果任何字段是空的想显示Toast message to fill.现在我需要设置验证RadioButtonRadioGroup.我尝试此代码但但无法正常工作.建议我正确的方法.谢谢.

// get selected radio button from radioGroup
int selectedId = gender.getCheckedRadioButtonId();
// find the radiobutton by returned id
selectedRadioButton = (RadioButton)findViewById(selectedId);
// do what you want with radioButtonText (save it to database in your case)
radioButtonText = selectedRadioButton.getText().toString();

if(radioButtonText.matches(""))
{
    Toast.makeText(getApplicationContext(), "Please select Gender", Toast.LENGTH_SHORT).show();
    Log.d("QAOD", "Gender is Null");
}
else
{
    Log.d("QAOD", "Gender is Selected");
}
Run Code Online (Sandbox Code Playgroud)

android radio-group radio-button

64
推荐指数
5
解决办法
14万
查看次数

此Android SDK需要ADT版本23.0.0或更高版本.当前版本是22.6.请将ADT更新到最新版本?

我从这个网站Developer.Android下载并安装了带有Android SDK for Eclipse的Eclipse ADT .当我尝试创建AVD设备时出现错误,Location of Android SDK has not been setup in Preferences.PreferencesWindows菜单栏打开然后我尝试设置SDK位置,但它显示错误此Android SDK需要ADT版本23.0.0或更高版本.当前版本是22.6.请将ADT更新到最新版本.如何更新?帮我创建android项目.

eclipse sdk android

63
推荐指数
2
解决办法
10万
查看次数

如何以编程方式重新启动Android应用程序

我想通过待处理意图重新启动我的应用程序。下面的代码不起作用。

val intent = Intent(this, Activity::class.java).apply {
     flags = Intent.FLAG_ACTIVITY_CLEAR_TOP
}
val pendingIntentId = 1
val pendingIntent = PendingIntent.getActivity(this, pendingIntentId, intent, PendingIntent.FLAG_CANCEL_CURRENT)
val mgr = getSystemService(Context.ALARM_SERVICE) as AlarmManager
val timeToStart = System.currentTimeMillis() + 1000L
mgr.set(AlarmManager.RTC, timeToStart, pendingIntent)
exitProcess(0)
Run Code Online (Sandbox Code Playgroud)

目标版本是 31,因此更新了未决意图,但PendingIntent.FLAG_MUTABLE仍然不起作用。我搜索了许多与此相关的链接,但没有运气。

以编程方式重新启动 Android 应用程序

强制应用程序在第一个活动时重新启动

https://www.folkstalk.com/tech/restart-application-programmatically-android-with-code-examples/#:~:text=How%20do%20I%20programmatically%20restart,finishes%20and%20automatically%20relaunches% 20us.%20%7D

2022 年 11 月,当目标版本为 31 且最低 sdk 版本为 29 时,上述待处理意图代码不会重新启动应用程序。

除了重新启动活动之外,还有为什么上述未决意图不起作用的任何线索或任何其他建议吗?我不想使用重新启动startActivity(intent)

android alarmmanager android-pendingintent

8
推荐指数
1
解决办法
3714
查看次数

如何使用jQuery-mobile dreamviewer cc和android中的phonegap在sqlite数据库中存储数据?

在Dreamweaver CC中使用Phone-gap开发Android应用程序的新手.我设计了简单的表单,有4个字段,我需要在sqlite数据库中存储这些字段?在eclipse中导入sqlite数据库并打开数据库连接然后创建表和存储数据.这工作正常,我需要在Dreamweaver CC中做同样的事情吗?

import android.database.sqlite.SQLiteDatabase;
SQLiteDatabase db;
db = this.openOrCreateDatabase("QAOD", MODE_PRIVATE, null);
db.execSQL("INSERT INTO TableName(Id) VALUES(18)");
Run Code Online (Sandbox Code Playgroud)

这个格式代码在eclipse android中工作正常,但是我需要使用这个代码并将数据存储在带有Phone-gap的Dreamweaver CC中的sqlite中.帮帮我或建议我存储数据.

sqlite android dreamweaver jquery-mobile cordova

6
推荐指数
1
解决办法
1844
查看次数

这会导致集合中的两个绑定绑定到同一属性.参数名称:c#中的绑定错误?

我试图将数据源绑定到DevExpress.XtraEditors.LookupEdit运行时.我试过这段代码,但收到以下错误:

这会导致集合中的两个绑定绑定到同一属性.参数名称:绑定.

这是我的代码:

// Create an adapter to load data from the "Customers" table.
OleDbDataAdapter testcustomers = new OleDbDataAdapter(
"SELECT CustomerId, Customername FROM Customer WHERE CompanyId =" + TXE_CompId.Text, connection);
DataSet ds = new DataSet();  // Create a dataset that will provide data from the database.
testcustomers.Fill(ds, "Customer");  // Load data from the "Customers" table to the dataset.
// A BindingSource for the "Customers" table.
BindingSource binding_cust = new BindingSource(ds, "Customer");

CBL_SelectCustomer.DataBindings.Add("EditValue", binding_cust, "CustomerId");  // getting error on …
Run Code Online (Sandbox Code Playgroud)

c# devexpress winforms

5
推荐指数
2
解决办法
9272
查看次数

如何使用c#Winforms执行字符串和整数?

在我的发票表格中textEdit1,它"INV001"最初是在第一次显示.然后我们将Invoice表单详细信息存储到MS Access数据库.下次on-wards会textEdit1自动想要显示下一个发票号码"INV002".怎么做?

如果它只是数字我尝试这个代码工作成功,但现在我也有3个字母,所以如何执行此操作?

OleDbConnection con =
    new OleDbConnection("Provider=Microsoft.ACE.OLEDB.12.0;Data Source=D:/Srihari/Srihari/Invoice.accdb");
con.Open();

OleDbCommand cmd =
    new OleDbCommand(
        "SELECT * FROM NewInvoice_1 WHERE InvoiceNumber = (select max(InvoiceNumber) from NewInvoice_1)",
        con);

OleDbDataReader reader = cmd.ExecuteReader();
while (reader.Read())
{
    int a = reader.GetInt32(1);
    TXE_Invoice_Number.Text = (1 + a).ToString();
}
Run Code Online (Sandbox Code Playgroud)

c# ms-access winforms

4
推荐指数
1
解决办法
477
查看次数

如何为未绑定列单元格设置值?(SetRowCellValue) Grinview Winforms Devexpress

我可以从 Db 将值设置为有界列。

使用此代码

int c = a + b;
Run Code Online (Sandbox Code Playgroud)

gridView1.SetRowCellValue(gridView1.FocusedRowHandle, gridView1.Columns["boundcolumn"], c);

但我想将此 c 值设置为未绑定列。此代码不适用于未绑定列。如何将值设置为 Unbound Coulmn ?

c# gridview devexpress winforms

3
推荐指数
1
解决办法
1万
查看次数

此子查询最多可以返回一条记录.(错误3354)

您好我的查询得到此错误有助于我恢复它

SELECT CompanyId, CompanyName, RegistrationNumber,
  (select CompanyAddress from RPT_Company_Address where 
   RPT_Company_Address.CompanyId=Company.CompanyId) AS CompanyAddress, 
  MobileNumber, FaxNumber, CompanyEmail, CompanyWebsite, VatTinNumber
FROM Company;`
Run Code Online (Sandbox Code Playgroud)

sql ms-access

2
推荐指数
1
解决办法
1万
查看次数

在AndroidPicker的6-8-2014到06-08-2014的DatePicker中处理零?

在我简单的Android应用程序中显示当前日期05-08-2014.使用此代码

SimpleDateFormat sdf = new SimpleDateFormat("dd-MM-yyyy");
String currentDate = sdf.format(new Date());
datepick.setText(currentDate);
Run Code Online (Sandbox Code Playgroud)

当用户想要更改日期时,我将DatePicker用于该textview(datepick).使用此代码

//To show current date in the datepicker
Calendar mcurrentDate=Calendar.getInstance();
int mYear = mcurrentDate.get(Calendar.YEAR);
int mMonth = mcurrentDate.get(Calendar.MONTH);
int mDay = mcurrentDate.get(Calendar.DAY_OF_MONTH);

DatePickerDialog dpdialog=new DatePickerDialog(QAOD_Tab_1.this, new OnDateSetListener(){
@Override
public void onDateSet(DatePicker view, int selectedyear, int selectedmonth, int selectedday) {
datepick.setText(new StringBuilder()
.append(selectedday).append("-").append(selectedmonth + 1).append("-")
.append(selectedyear).append(" ")); 

}
}, mYear, mMonth, mDay);
dpdialog.setTitle("Select Date");                
dpdialog.show();  ` 
Run Code Online (Sandbox Code Playgroud)

现在我得到这样的日期5-8-2014.我还需要在日期和月份之前显示零.如何以这种格式显示零.我需要像这样的结果05-08-2014.

android datepicker

2
推荐指数
2
解决办法
1384
查看次数

INSERT INTO语句中的语法错误c#.net Winforms Devexpress?

我从DateEdit获取日期并尝试存储到Access数据库.但它显示这样的错误

Syntax error in INSERT INTO statement.

我的插入语句是这样的

 OleDbCommand top = new OleDbCommand("INSERT INTO invoice(invoice_number,order_number,customername,status,subtotal,tax,total,date) VALUES (" + inno + "," + odrno + ",'" + name + "','"+ chk1 +"' ,"+ subtottal +","+ tax +","+total+",'"+date+"')", conn);
 top.ExecuteNonQuery();
Run Code Online (Sandbox Code Playgroud)

除了日期剩余值存储成功但我如何存储日期?

我得到这样的约会 DateTime date = dateEdit1.DateTime;

帮我.

c# ms-access winforms

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