我正试图让我的活动关闭并返回结果,我在父活动中确实有onActivityResult,并且我在其它工作的地方使用了接近相同的方法.
public void deleteFile(){
boolean deleted=FileManager.getInstance().deleteMeasurementData(this.getIntent().getData(), this);
if(deleted){
Toast.makeText(this, originalData.getName() +".mmd Has been deleted", Toast.LENGTH_SHORT);
setResult(EditMeasurement.RESULT_YES_DELETED);
finishActivity(EditMeasurement.RESULT_YES_DELETED);
}else {
Toast.makeText(this, originalData.getName() +".mmd did NOT delete", Toast.LENGTH_SHORT);
Log.e(TAG, "File did NOT delete error");
}
}
Run Code Online (Sandbox Code Playgroud)
从此菜单调用此方法:
public boolean onOptionsItemSelected(MenuItem item) {
// Handle item selection
Log.i(TAG, "something choosen "+item.getItemId()+" it should have been: "+R.id.om_measurement_menu_delete);
switch (item.getItemId()) {
case R.id.om_measurement_menu_edit:
editFile();
return true;
case R.id.om_measurement_menu_delete:
deleteFile();
return true;
case R.id.om_measurement_menu_cancel:
endActivity();
return true;
default:
return super.onOptionsItemSelected(item);
}
}
Run Code Online (Sandbox Code Playgroud)
谁有任何明智的想法,为什么它不关闭?
Hej,我目前正试图让AudioRecord工作.因为我需要一个更大的项目.但它似乎搞得很多.我一直在尝试很多东西,所以当我追踪这个bug时我回到了基础.我正在使用我的三星Galaxy S作为我的调试设备.
我的问题是,第一次重启我的设备后,我可以初始化我创建的AudioRecord对象没有问题.但是第二次运行它时,它不会初始化AudioRecord对象.我已经尝试了几个频率,fyi.
这是我的代码:
package android.audiorecordtest;
import android.app.Activity;
import android.media.AudioFormat;
import android.media.AudioRecord;
import android.media.MediaRecorder;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;
import android.widget.TextView;
public class AudioRecordTest extends Activity {
int frequency;
AudioRecord audRec;
TextView txtVw;
/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
txtVw = (TextView) findViewById(R.id.txtVw);
frequency=8000;
int bufferSize=(AudioRecord.getMinBufferSize(frequency, AudioFormat.CHANNEL_IN_MONO, AudioFormat.ENCODING_PCM_16BIT))*2;
if (bufferSize>0) {
audRec = new AudioRecord(MediaRecorder.AudioSource.MIC, frequency, AudioFormat.CHANNEL_IN_MONO, AudioFormat.ENCODING_PCM_16BIT, bufferSize);
int status = audRec.getState();
if (status == …Run Code Online (Sandbox Code Playgroud) Zxings barscanner app,我已经实现了它,作为一个图书馆项目,它的工作原理.
现在我要改变扫描的字段(目标字段)的大小(也完成).(虽然扫描区域保持不变,但这并不重要,因为焦点仍在中心位置.)
但后来我需要在左侧插入一个菜单.这迫使我改变目标字段,这是它开始崩溃,如果我改变了surfaceview或viewFinderView的大小,如果我将它包装在相对视图中,它仍然只解码中心(原因).我只是无法找到解决方案: - /
简短:我可以更改扫描应该发生的区域,但这只是可见的.实际扫描区域仍然是整个屏幕的中心,而不是移动的可见扫描区域的中心.
谁能帮我?
layout XML(插入菜单,不必要删除):
<SurfaceView
android:id="@+id/preview_view"
android:layout_width="fill_parent"
android:layout_height="fill_parent" />
<com.google.zxing.client.android.ViewfinderView
android:layout_marginLeft="120dip"
android:id="@+id/viewfinder_view"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:background="@color/transparent" />
<LinearLayout
android:id="@+id/buttonPanel"
android:layout_width="120dip"
android:layout_height="fill_parent"
android:background="#000"
android:orientation="vertical"
android:paddingBottom="15dip"
android:paddingTop="15dip" >
<TextView
android:id="@+id/menuText"
android:layout_weight="1"
android:layout_width="90dip"
android:layout_height="wrap_content"
android:layout_marginLeft="15dip"
android:text="@string/menu_title"/>
<ImageView
android:id="@+id/d1Button"
android:layout_width="90dip"
android:layout_height="wrap_content"
android:layout_marginLeft="15dip"
android:layout_weight="2"
android:onClick="scanner1d"
android:src="@drawable/d1image" />
<ImageView
android:id="@+id/d2Button"
android:layout_width="90dip"
android:layout_height="wrap_content"
android:layout_marginLeft="15dip"
android:layout_weight="2"
android:onClick="scanner2d"
android:src="@drawable/d2image" />
</LinearLayout>
<LinearLayout
android:id="@+id/result_view"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:background="@color/result_view"
android:orientation="vertical"
android:padding="4dip"
android:visibility="gone" >
**removed**
</LinearLayout>
**removed**
Run Code Online (Sandbox Code Playgroud)
左图:现在是视图的方式,项目放在无法识别的位置.
右图:放置在识别位置的项目(如何检查目标区域是否未更改):

对CameraManager的更改(挤压取景器):
public Rect getFramingRect() {
// added …Run Code Online (Sandbox Code Playgroud) HikariPool-1 - Connection marked as broken because of SQLSTATE(08S01), ErrorCode(-99999)
java.sql.SQLNonTransientConnectionException: Communication link failure. (Read timed out)
Run Code Online (Sandbox Code Playgroud)
在创建一个包含大约 600 万条记录的数据表时,我一直遇到这个问题。在 ACS(一个 sql 开发人员)上,大约需要 1.5 分钟。
操作系统:ubuntu 11.10
Eclipse:面向Web开发人员的Java EE IDE.版本:Indigo Service Release 2构建ID:20120216-1857 Java:jdk1.7.0_03 SDK adb:Android Debug Bridge版本1.0.29
尝试使用m2e android(2.8.4)在eclipse中构建javaocr.它会导致项目在pom.xml中生成错误:
Description Resource Path Location Type
Plugin execution not covered by lifecycle configuration: com.jayway.maven.plugins.android.generation2:maven-android-plugin:2.8.4:generate-sources (execution: default-generate-sources, phase: generate-sources) pom.xml /javaocr-sampler line 20 Maven Project Build Lifecycle Mapping Problem
Plugin execution not covered by lifecycle configuration: com.jayway.maven.plugins.android.generation2:maven-android-plugin:2.8.4:unpack (execution: default-unpack, phase: process-classes) pom.xml /javaocr-sampler line 20 Maven Project Build Lifecycle Mapping Problem
Plugin execution not covered by lifecycle configuration: org.apache.maven.plugins:maven-resources-plugin:2.5:resources (execution: default-resources, phase: process-resources) pom.xml /javaocr-sampler line 11 …Run Code Online (Sandbox Code Playgroud) 当我在Eclipse中创建一个新项目时,会立即发生这种情况.
我在项目中只有1个jar文件,我试图将其删除,然后重复添加几次,并在此之后清理项目.
我更新了ProGuard(我认为),下载了新版本,并将lib文件夹替换为此处的线程说.
我的default.properties文件如下所示:
# This file is automatically generated by Android Tools.
# Do not modify this file -- YOUR CHANGES WILL BE ERASED!
#
# This file must be checked in Version Control Systems.
#
# To customize properties used by the Ant build system use,
# "build.properties", and override values to adapt the script to your
# project structure.
# Project target.
target=android-8
Run Code Online (Sandbox Code Playgroud)
因此无法评论ProGuard的任何内容,这也是另一个线程中提到的.我觉得我已经尝试了一切,但仍然存在这个错误.如果我去,我注意到的一件事:
window -> preferences -> android -> build.并取消选中"当外部jar包含本机库时强制错误".然后我得到:"无法解决R" …
如下图所示,地图仅显示在左上角,可以在整个屏幕上拖动它,但它会跳回到那个方块并且只显示在那里.
Title:SemiOfficial jquery插件中提到的插件
所以我想知道如何解决这个问题?
在图片下方你会找到我的html,插件列表和js代码.

HTML/JSP :(应该提到这是我的应用程序中的第二个.jsp,所以它应该有希望在pageinit方法中初始化)
<!DOCTYPE html>
<html>
<head>
<title>Map</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="js/jquery.mobile-1.1.0.css" />
</head>
<body>
<!-- Start of first page -->
<div data-role="page" id="mapmode" name="mapmode">
<div data-role="header" id="header" name="header">
<p>Header</p>
</div><!-- /header -->
<div data-role="content" id="content" name="content">
<div id="map_canvas" style="width:300px;height:350px"></div>
</div><!-- /content -->
</div><!-- /page -->
</body>
</html>
Run Code Online (Sandbox Code Playgroud)
插件:
<script type="text/javascript" src="js/jquery-1.7.2.js"></script>
<script type="text/javascript" src="js/jquery.mobile-1.1.0.js"></script>
<script type="text/javascript"
src="http://maps.googleapis.com/maps/api/js?key=_MY_KEY__INSERT_HERE_&sensor=true">
</script>
<script type="text/javascript" src="js/jquery.ui.map.js"></script>
<script type="text/javascript" src="js/cordova-1.9.0.js"></script>
<script type="text/javascript" src="js/FileManager.js"></script>
<script …Run Code Online (Sandbox Code Playgroud) 我希望有人能告诉我为什么我的Tesseract无法识别带有数字的图像,如果有什么我可以做的事情.一切都按照测试工作,因为它只是我需要的数字,我以为我可以用英语模式管理,直到我不得不从7分段显示开始.
虽然我对附加的图像有很多麻烦,但我想知道我是否应该开始使用我自己的识别算法,或者我是否可以为Tesseract做我自己的数据集然后它会工作,有谁知道在哪里Tesseract的局限性在于什么?
事情尝试:尝试将psm设置为one_line,one_word,one_char(并切断图片).使用one_line和one_word没有重大变化.使用one_char它确实感觉好一点,但有时候,由于大的间距,它附加了一个额外的数字,然后拧紧它,如果你看附加的图像
然后它导致了04.我自己也试图进行二值化,这导致了更差的识别并且非常耗费资源.我试图反转图片,这对于tesseract没有任何区别.
我附上了我需要的照片以供处理.
关于图像的解释:
这是一个tesseract没有识别的图像,虽然它是为了方便在工作图像周围构建应用程序而制作的.
是与image_seven匹配的真实生活图像.但它无法识别这一点.
是我想要识别的另一个图像,是的,我知道它不能被浏览,而且我在测试时做了未提取(想想skrew是这里的术语=="直接").
我想将我的Android手机(2.3.6 Samsung Note)连接到嵌入式蓝牙设备(Arduino上的RN-42 BT UART模块).开始使用BluetoothChat示例,并将嵌入式设备与手机配对.到目前为止,所有设备似乎都运行良好,设备连接,数据从Android传递到嵌入式设备.我仍然缺少的是让设备在两个范围内自动连接.
使用调试器我看到嵌入式设备是"主机"或其中的术语"从属",Android是客户端,因为Android发出连接请求.
我的问题是将div放在"动态图片"下,并在动态图片下方的div下面有动态内容:
jsfiddle css类准备填写:
HTML:
<div id="wallDetailContent">
<section id="wallDetailMessage" style="width 100%">
<img class="wallDetailPicture" src="http://web.scott.k12.va.us/martha2/dmbtest.gif">
<div style="max-width:70%;">blah gik sig en tur, og købte blah med hjem</div>
</section>
<section class="belowPicture">
<p class="wallByDate"> 20140126220550</p>
<p class="wallByBy"> af </p>
<p class="wallByName"> Anders </p>
</section>
<section class="belowBelowPicture">
content (should be dynamic, able to fill all the height it need downwards.)
</section>
</div>
Run Code Online (Sandbox Code Playgroud)
CSS:
.wallDetailPicture{
top: 5px;
right : 5px;
position: absolute;
display:box;
width:auto;
height:auto;
max-width:30%;
max-height: 200px;
}
.wallByName{
font-weight: bold !important; …Run Code Online (Sandbox Code Playgroud) 以下制作a的示例position : fixed在我的FF16.02/IE9中不起作用.但就我所知,它应该是与浏览器兼容的.有任何想法吗?
嘿我正在尝试重新创建一个包含大约900万条记录的表,当我这样做时,我想首先在表上删除/暂停索引,然后重新创建/启动它们.
我们正在运行IBMI 7.3.
我已经创建了下面的存储过程来执行此操作.但是一旦它命中Drop索引语句,它就会"崩溃/停止",但不会出错.
任何人都知道如何做到这一点?
CREATE PROCEDURE YXDB.GENERATE_SEARCH_DATA()
LANGUAGE SQL MODIFIES SQL DATA
SET OPTION DBGVIEW=*SOURCE,COMMIT=*NONE,OUTPUT=*PRINT
P1: BEGIN
DECLARE is_there_index INT;
DECLARE zero_index INT;
DECLARE first_index INT;
DECLARE next_index INT;
DECLARE pre_phonetic_string varchar(100);
DECLARE post_phonetic_string varchar(100);
DECLARE search_string_actionable varchar(100);
DECLARE END_TABLE INT DEFAULT 0;
DECLARE ADDRESS_KEY INT;
DECLARE ADDRESS_INFO VARCHAR(500);
DECLARE ACTIVE INT;
DECLARE C1 CURSOR FOR
select distinct faadrnr,
info,
(case
WHEN FKRELTYP like 'FFADRESSE%' AND FKKNTNR = 0
THEN (select 1 from dual)
WHEN FKRELTYP like 'SMOLEVADR%' AND …Run Code Online (Sandbox Code Playgroud) android ×7
css3 ×2
db2-400 ×2
eclipse ×2
alsa ×1
audio ×1
bluetooth ×1
css ×1
css-position ×1
dalvik ×1
hikaricp ×1
ibm-midrange ×1
javascript ×1
jquery ×1
m2e ×1
maven ×1
ocr ×1
position ×1
sample-rate ×1
spring-boot ×1
tesseract ×1
zxing ×1