好吧,我知道有很多问题,但它们都来自很久以前.
所以.我知道这是可能的,因为地图应用程序可以做到这一点.
在地图应用程序中,如果我关闭此应用程序的本地化,它会向我发送一条消息,如果我按好,"设置应用程序"将打开.我的问题是,这怎么可能?如何从我自己的应用程序中打开"设置应用程序"?
基本上我需要做同样的事情,如果用户关闭我的应用程序的位置,那么我会给他一条消息,说明会打开"设置应用程序"
我知道单个感叹号的定义,但两个?
我今天正在编码,编译器"强迫"我再添加一个!我的句子:
mySignal.subscribeNext({
(value: AnyObject!) -> () in
let list: RACSequence = value["myObject"]!!.rac_sequence
...
Run Code Online (Sandbox Code Playgroud)
如果我只使用一个!mark,项目没有编译,给我错误:"可选类型的值'AnyObject?' 没打开;你的意思是用'!' 要么 '?'?" 然后我再添加一个!一切正常.
Swift中两个感叹号的含义是什么?
我试图弄清楚如何从URL启动应用程序,以及我应该如何编写该URL.
我的AndroidManifest中有以下代码:
<activity android:name=".MyActivity">
<intent-filter>
<action android:name="android.intent.action.MAIN"></action>
<action android:name="android.intent.action.VIEW"></action>
<category android:name="android.intent.category.LAUNCHER"></category>
<category android:name="android.intent.category.DEFAULT"></category>
<category android:name="android.intent.category.BROWSABLE"></category>
<data android:host="my.app" android:scheme="http"></data>
</intent-filter>
</activity>
Run Code Online (Sandbox Code Playgroud)
我使用了本回答中解释的URL ,但没有任何反应.
如果我的意图写得很好,请告诉我,以及我应该如何编写调用该应用程序的URL,并注意我需要调用我的"主要"活动.
我试图让我的setOnItemClickListener工作,但是当我添加方法时,Eclipse说我应该删除"@Override"注释,如果我这样做,那么监听器就不起作用了.问题是我需要捕获"点击"事件并做一些事情......这是我的方法:
list.setOnItemClickListener(new OnItemClickListener() {
@Override //<-- this is the annotation that eclipse says I should remove
public void onItemClick(AdapterView<?> parent, View view,
int position, long id) {
}
});
Run Code Online (Sandbox Code Playgroud)
我确定问题不在于方法本身,我想这是另一回事.请查看我的活动并告诉我出错了什么:
import java.io.IOException;
import java.util.ArrayList;
import java.util.HashMap;
import android.app.Activity;
import android.content.Intent;
import android.database.SQLException;
import android.os.Bundle;
import android.view.Menu;
import android.view.MenuItem;
import android.widget.ListView;
import android.view.View;
import android.widget.AdapterView;
import android.widget.AdapterView.OnItemClickListener;
public class Sounds extends Activity{
ListView list;
LazyAdapter adapter;
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.list_table);
list=(ListView)findViewById(R.id.list);
ArrayList<HashMap<String, String>> songsList = new ArrayList<HashMap<String, …Run Code Online (Sandbox Code Playgroud) 我正在制作一个应用程序来显示用户当前位置附近的一些地方。当用户移动地图时,地图会一遍又一遍地将用户移动到他的当前位置。因此,用户无法看到地图上的注释,因为如果他移动地图,地图就会返回到他当前的位置。
这就是我现在正在做的事情:
- (void)mapView:(MKMapView *)mapView didUpdateUserLocation:(MKUserLocation *)userLocation
{
if (userLocation)
{
MKCoordinateRegion region = MKCoordinateRegionMakeWithDistance(userLocation.coordinate, 1000, 1000);
MKCoordinateRegion regionDelMapa = [self.mapa regionThatFits:region];
if(isnan(regionDelMapa.center.latitude))
{
NSLog(@"Bad region...");
}else
{
[self.mapa setRegion:regionDelMapa animated:YES];
}
}
}
Run Code Online (Sandbox Code Playgroud)
我在这里尝试了一些其他答案,但没有任何反应。这不是所需的行为,那么我怎样才能停止更新用户的当前位置呢?
我已经用Google搜索了答案,但没有任何反应......我需要更改显示当前位置的蓝点文本.当您对您的位置进行地理定位时,iPhone会向您显示您的位置的蓝点,如果您点按它,它会显示一个显示"当前位置"的文本.我需要用例如"你在这里"之类的东西改变那个文本.
我非常感谢你的回答,谢谢.
好吧,就是这样!我需要将字符串文本(如"Hrd $ 457")转换为long值.黑莓IDE有一个按钮,但我需要通过代码执行此操作.请注意,该字符串是字母数字.
谢谢!
注意:对不起,如果我的问题不是很清楚.我正在谈论的IDE按钮将整个字符串转换为一个long值,使该字符串成为唯一的数字.BlackBerry文档说:
"要创建唯一的长密钥,请在BlackBerry®IntegratedDevelopment Environment中键入字符串值.com.rim.samples.docs.userinfo右键单击该字符串,然后单击将'com.rim.samples.docs.userinfo'转换为长."
所以,我需要通过代码完全相同.
我真的很感谢你们的帮助伙伴们,非常感谢你们的帮助.
我从服务器获取一个 JSON,它是我的 ListView 的内容。一切都很好,但我想在调用 Json 时创建一个 ProgressDialog。问题是我需要在不同的线程中调用 JSON(使用 http 方法)并在 ListView 中向用户显示结果。
这就是我正在做的事情,但出现了错误"05-09 12:13:28.358: W/System.err(344): android.view.ViewRoot$CalledFromWrongThreadException: Only the original thread that created a view hierarchy can touch its views."
try {
final ProgressDialog progDailog;
progDailog =ProgressDialog.show(this,"HI", "Loading");
new Thread(new Runnable() {
@Override
public void run() {
try
{
JSONArray json = new JSONArray(executeHttpGet("http://m-devsnbp.insightlabs.cl/cuentos/json"));
progDailog.cancel();
ArrayList<HashMap<String, String>> talesList = new ArrayList<HashMap<String, String>>();
talesList = jsonToHash(json);
adapter = new LazyAdapter((Activity) ctx, talesList, 2);
list.setAdapter(adapter);
}
catch (InterruptedException e)
{
e.printStackTrace();
} …Run Code Online (Sandbox Code Playgroud) 我正在使用嵌入式SQLite数据库制作iOS应用程序.所以我在SQLite管理员中创建我的数据库并将其拖到我的Xcode项目中,就像在教程中说的那样.当我尝试打开我的数据库时,我收到此错误:"内存不足".不知道它是否是一个SQLite错误或什么,但我的文件真的很小,以解决内存问题.
这是我的初始化DataBase的代码:
- (id)initWithPath:(NSString *)path {
if (self = [super init]) {
BOOL success;
NSError *error;
NSFileManager *fileManager = [NSFileManager defaultManager];
NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);
NSString *documentsDirectory = [paths objectAtIndex:0];
NSString *dbPath = [documentsDirectory stringByAppendingPathComponent:@"SoundLib_DB.sqlite"];
if ([fileManager fileExistsAtPath:dbPath] == NO) {
NSString *resourcePath = [[NSBundle mainBundle] pathForResource:@"SoundLib_DB" ofType:@"sqlite"];
[fileManager copyItemAtPath:resourcePath toPath:dbPath error:&error];
}
success = [fileManager fileExistsAtPath:dbPath];
if(!success)
{
NSLog(@"Cannot locate database file '%@'.", dbPath);
}
sqlite3 *dbConnection;
//Here is when I get the error, at trying to …Run Code Online (Sandbox Code Playgroud) ios ×4
android ×3
iphone ×3
objective-c ×2
appsettings ×1
blackberry ×1
geolocation ×1
intentfilter ×1
java-me ×1
listview ×1
location ×1
long-integer ×1
mapkit ×1
mkmapview ×1
sqlite ×1
string ×1
swift ×1