我试图通过ADB找到一种在Android(三星)中启动短信意图的方法:
adb shell am start -n com.android.mms/.ui.ConversationComposer
我设法发现包名是“com.android.mms”,意图是“.ui.ConversationComposer”。
然而,这将直接启动New compose消息意图,而我尝试启动所有SMS的视图(它应在我的Android手机中列出SMS)。当我使用“adb dumpsys window Windows”追踪时,SMS列表仍然使用上述意图(ui.ConversationComposer)。
解决方法是启动SMS Composer并运行两次
adb shell input keyevent KEYCODE_BACK
如何进入此视图而无需启动Composer视图并使用ADB按两次?
答案 0 :(得分:1)
我发现了另一项解决方案来自link:
adb shell monkey -p your.app.package.name -c android.intent.category.LAUNCHER 1
答案 1 :(得分:1)
你试过这个:
int d;
if (Session["UserCheck"] != null)
{
d = Convert.ToInt32(Session["CustomerID"]);
}
else
{
return;
}
// Query: 01
// Getting Account_No from Customers and matching with enterd Account_No in txtAcntNo.Text
SqlCommand cmd1 = new SqlCommand("select COUNT(Coalesce(Account_No, '0')) FROM [NewImport_DB].[dbo].[Customer] where Account_No = '" + txtAcntNo.Text + "' AND Cus_ID = '"+d+"' ", con);
con.Open();
var acc = cmd1.ExecuteScalar().ToString();
con.Close();
// Query: 02
// Getting Total Amount from User Cart/Order_Details
SqlCommand cmd3 = new SqlCommand("SELECT [Total_Amount] FROM [NewImport_DB].[dbo].[Payments] WHERE Date IN (SELECT max(Date) FROM Payments)", con);
con.Open();
var T_Ordr_Amount = (Int32)cmd1.ExecuteScalar(); // Contains Total_Amount from User Cart/Order_Details
con.Close();
// Query: 03
// Getting SUM(Amount) from Bank_Acount Table
SqlCommand cmd2 = new SqlCommand("select SUM(Amount) AS T_Amount FROM [NewImport_DB].[dbo].[Bank_Acount] where Account_No = '" + txtAcntNo.Text + "' AND User_ID = '" + d + "' ", con);
con.Open();
var bnd_acc = (Int32)cmd1.ExecuteScalar(); // Contains SUM(Amount) from Bank_Acount Table
con.Close();
if (acc == "1") // if Account_No is matched
{
if (bnd_acc > T_Ordr_Amount) // if SUM(Amount) in Bank_tbl > Total_Amount from Customer_Order_Details
{
con.Open();
SqlCommand cmd = con.CreateCommand();
cmd.CommandType = CommandType.Text;
cmd.CommandText = "INSERT INTO [NewImport_DB].[dbo].[Transfer_Pay]([User_ID] ,[Bank_Name], [Account_No] ,[Date]) VALUES ('" + d + "' ,'" + txtBnkame.Text + "', '" + txtAcntNo.Text + "', GETDATE())";
cmd.ExecuteNonQuery();
con.Close();
Response.Redirect("/shipments.aspx");
}
else
{
Response.Write("<script>alert('You have less balance in your Bank Account, Please Deposit the money to purchase again!')</script>");
}
}
else
{
Response.Write("<script>alert('You entered invalid Account No!')</script>");
}