我需要使用共享意图活动从我的应用程序共享位置,我已经通过一些示例并知道如何实现共享意图.但是我被困在setType.我需要我的应用程序在地图上共享位置详细信息以及用户位置.
顺便说一句,我用一个非常相似的问题复制用户代码"没有冒犯"
任何帮助将非常感谢.
Intent intent1 = new Intent(Intent.ACTION_SEND);
intent1.setType("text/plain");
intent1.putExtra(Intent.EXTRA_TEXT, "The status update text");
startActivity(Intent.createChooser(intent1, "Select prefered Service"));
Run Code Online (Sandbox Code Playgroud) 修复了链接,现在我收到了一个JSON错误信息
java.lang.ClassCastException: org.json.JSONObject$1 cannot be cast to org.json.JSONObject
Run Code Online (Sandbox Code Playgroud)
显然我的错误在于某处:
String response = streamToString(urlConnection.getInputStream());
JSONObject jsonObj = (JSONObject) new JSONTokener(response).nextValue();
JSONArray groups = (JSONArray) jsonObj.getJSONObject("response").getJSONArray("groups");
int length = groups.length();
if (length > 0) {
for (int i = 0; i < length; i++) {
JSONObject group = (JSONObject) groups.get(i);
JSONArray items = (JSONArray) group.getJSONArray("items");
int ilength = items.length();
for (int j = 0; j < ilength; j++) {
JSONObject item = (JSONObject) items.get(j);
FsqVenue venue = new FsqVenue();
venue.id = item.getString("id"); …Run Code Online (Sandbox Code Playgroud) 我需要在php/mysql中比较日期和时间基本上我有一个应用程序和服务器应用程序需要连接到服务器以检查数据库中的新条目.服务器从应用程序接收日期时间作为字符串,这是在这里完成的
SimpleDateFormat dateformat = new SimpleDateFormat("yyyy/mm/dd hh:mm:ss");
Calendar cal = Calendar.getInstance();
String time = dateformat.format(cal.getTime());
Run Code Online (Sandbox Code Playgroud)
服务器在这里接收数据
f (isset($_GET["time"]) || isset($_GET["user_id"])) {
$time = $_GET['time'];
$u_id = $_GET['user_id'];
$timestr=date('y-m-d H:i:s',strtotime($time));
$result = mysql_query("SELECT MAX(created_at)from room");
$Max_time = mysql_result($result, $row);
$dbMax_time = date('y-m-d H:i:s',strtotime($Max_time));
Run Code Online (Sandbox Code Playgroud)
并且需要在这里进行比较
if ($dbMax_time> $timestr) {
$NewRooms = mysql_query("SELECT * From room WHERE created_at> CAST($timestr AS TIME)");
}
Run Code Online (Sandbox Code Playgroud)
我如何去解决这个问题如何比较请帮助我修复它.