我对编程有点新意,所以我确信这是一个简单的答案.
基本上,在我的主要方法中,我想这样做:
...
wordtime = new LabelField("" + DataStored.words[0]);
...
现在在DataStored类中我有:...
public static String[] words;
{
words = new String[2];
words[0] = "Oil sucks!";
words[1] = "Do you know that I can talk?";
}
Run Code Online (Sandbox Code Playgroud)
...
因此,每当我尝试编译程序时,它都会在主类中停止,因为DataStored.words [0]为空.如何让它填充其他类的字段?先感谢您!
我有一个Image对象,它是相机拍摄的jpg图片,我需要从中创建一个Bitmap.
除了使用BMPGenerator类之外,还有什么办法吗?我正在开展一个商业项目,由于GPLv3许可证,我认为我不能使用它.
到目前为止,这是我的代码.我可以用它做点什么吗?
FileConnection file = (FileConnection) Connector.open("file://" + imagePath, Connector.READ_WRITE);
InputStream is = file.openInputStream();
Image capturedImage = Image.createImage(is);
Run Code Online (Sandbox Code Playgroud)
我试过这个,但是我无法获得正确的文件,而且图像被卡在空中
EncodedImage image = EncodedImage.getEncodedImageResource(filePath);
byte[] array = image.getData();
capturedBitmap = image.getBitmap();
Run Code Online (Sandbox Code Playgroud) 我正在使用嵌入在Google网站上的Google日历.
BlackBerry用户报告错误,因此我想将其重定向到另一个页面.
我试图添加此代码
<script type="text/javascript">
var ua = navigator.userAgent;
var url = "http://optimizedmobile.yoursite.com/";
if (ua.indexOf("BlackBerry") >= 0)
{
if (ua.indexOf("WebKit") >= 0)
{
window.location = url;
}
}
</script>
Run Code Online (Sandbox Code Playgroud)
使用此处提供的说明,但它不起作用.我在我创建的html文件中测试了代码并且它有效.
那么,在页面上包含代码的任何其他想法?您认为Google网站不支持该代码吗?
重定向BB用户的任何其他想法?