- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我目前正在从事其他人的项目,因为他们已经离开了公司。我只是实习生,java不是我的强项。
基本上,应用程序的工作原理是从提要接收信息并将该信息放置在相关位置。
然而,客户要求在经出租同意的图像上放置图形。
这是为我完成的,因为我没有任何对提要的访问权限。
我想指出的是,带有图形的提要在 iPhone 应用程序上运行得非常好。
按下搜索按钮后,此消息将在我的日志猫中打印出来:java.io.FileNotFoundException:http://images.ultrait.me/ImageProcessor.aspx?imageURL=381/Sales/321470/53659_T_ADDRESSES_52050_TN.jpg&Text=LET同意
正如您通过单击链接看到的,图标出现了。
当我单击选项卡搜索属性时,提要将开始加载,并且图像将显示在 ListView 中。图像将会出现,但上面没有让同意的图标,我相信这是因为它将源中的图像之一作为缩略图,但我需要它来显示图形(我不确定这是否甚至是正确的)。
当我单击查看属性时,图像消失。
我的工作已经到了最后期限,但没有人可以帮助我。请耐心等待我。
以下是我的一些类(class),我认为您可能需要查看。
public class _06_Photos extends Activity implements ViewFactory{
private static final int SWIPE_MIN_DISTANCE = 120;
private static final int SWIPE_MAX_OFF_PATH = 250;
private static final int SWIPE_THRESHOLD_VELOCITY = 200;
//GUI Components
TextView tv_counter;
//ImageView iv_activity;
ImageSwitcher imageSwitcher;
Button b_play;
Button b_next;
Button b_previous;
FrameLayout topFrame, bottomFrame;
//Images and Stuff
String [] str_imageURLs;
Bitmap [] bm_images;
int picNum = 0;
boolean play;
boolean stop;
Handler handler;
Thread playThread;
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.xl_06_photos);
handler = new Handler();
playThread = new Thread(Play);
play = false;
stop = false;
playThread.start();
str_imageURLs = new String[5];
for(int i=0; i<5;++i)
str_imageURLs[i] = "";
bm_images = new Bitmap[5];
InitView();
Bundle extras = getIntent().getExtras();
if (extras != null) {
str_imageURLs[0] = extras.getString("img1");
str_imageURLs[1] = extras.getString("img2");
str_imageURLs[2] = extras.getString("img3");
str_imageURLs[3] = extras.getString("img4");
str_imageURLs[4] = extras.getString("img5");
}
for(int i=0; i<5; i++)
System.out.println(str_imageURLs[i]);
new Thread(new Runnable() {
public void run() {
for(int i=0; i<5; ++i)
{
try{
bm_images[i] = FindPropertyActivity.DownloadImage(str_imageURLs[i]);
}
catch(Exception e){
System.out.println("Image" + i + " not downloaded - " + e);
}
try{
if(bm_images[i] == null)
{
System.out.println("Bitmap " + i + " is null");
bm_images[i] = BitmapFactory.decodeResource(getResources(), R.drawable.download_error);
}
if(picNum == i)
//iv_activity.setVisibility(View.INVISIBLE);
//Drawable d =new BitmapDrawable(bm_images[i]);
//imageSwitcher.setImageDrawable(d);
handler.post(SetPic);
}
catch(Exception e){
System.out.println("PicNum null/visiablity" + i + " not setCorrectly - " + e);
}
}
System.gc();
}
}).start();
}
private void InitView(){
handler.post(SetPic);
tv_counter = (TextView)findViewById(R.id.photo_tv_counter);
imageSwitcher = (ImageSwitcher)findViewById(R.id.photo_imageSwitcher);
imageSwitcher.setFactory(this);
topFrame = (FrameLayout)findViewById(R.id.photo_topFrame);
bottomFrame = (FrameLayout)findViewById(R.id.photo_bottomFrame);
final GestureDetector gestureDetector = new GestureDetector(new MyGestureDetector());
imageSwitcher.setOnTouchListener(new View.OnTouchListener() {
public boolean onTouch(View v, MotionEvent event) {
gestureDetector.onTouchEvent(event);
return true;
}
});
b_play = (Button)findViewById(R.id.photo_b_play);
if(play){
b_play.setBackgroundDrawable(getResources().getDrawable(R.drawable.button_pause));
topFrame.setVisibility(View.INVISIBLE);
bottomFrame.setVisibility(View.INVISIBLE);
}
else{
b_play.setBackgroundDrawable(getResources().getDrawable(R.drawable.button_play));
}
b_play.setOnTouchListener(new View.OnTouchListener() {
public boolean onTouch(View v, MotionEvent event) {
if (event.getAction() == MotionEvent.ACTION_DOWN) {
Drawable background = v.getBackground();
background.setColorFilter(0xFF7A7A7A, PorterDuff.Mode.MULTIPLY);
v.setBackgroundDrawable(background);
} else if (event.getAction() == MotionEvent.ACTION_UP) {
Drawable background = v.getBackground();
background.setColorFilter(null);
v.setBackgroundDrawable(background);
if(play){
play = false;
b_play.setBackgroundDrawable(getResources().getDrawable(R.drawable.button_play));
}
else{
play = true;
b_play.setBackgroundDrawable(getResources().getDrawable(R.drawable.button_pause));
topFrame.setVisibility(View.INVISIBLE);
bottomFrame.setVisibility(View.INVISIBLE);
}
}
return false;
}
});
b_previous = (Button)findViewById(R.id.photo_b_previous);
b_previous.setOnTouchListener(new View.OnTouchListener() {
public boolean onTouch(View v, MotionEvent event) {
if (event.getAction() == MotionEvent.ACTION_DOWN) {
Drawable background = v.getBackground();
background.setColorFilter(0xFF7A7A7A, PorterDuff.Mode.MULTIPLY);
v.setBackgroundDrawable(background);
} else if (event.getAction() == MotionEvent.ACTION_UP) {
Drawable background = v.getBackground();
background.setColorFilter(null);
v.setBackgroundDrawable(background);
PreviousPic();
}
return false;
}
});
b_next = (Button)findViewById(R.id.photo_b_next);
b_next.setOnTouchListener(new View.OnTouchListener() {
public boolean onTouch(View v, MotionEvent event) {
if (event.getAction() == MotionEvent.ACTION_DOWN) {
Drawable background = v.getBackground();
background.setColorFilter(0xFF7A7A7A, PorterDuff.Mode.MULTIPLY);
v.setBackgroundDrawable(background);
} else if (event.getAction() == MotionEvent.ACTION_UP) {
Drawable background = v.getBackground();
background.setColorFilter(null);
v.setBackgroundDrawable(background);
NextPic();
}
return false;
}
});
}
public void onDestroy(){
super.onDestroy();
stop = true;
}
private final Runnable SetPic = new Runnable() {
public void run() {
//iv_activity.setVisibility(View.INVISIBLE);
Drawable d =new BitmapDrawable(bm_images[picNum]);
imageSwitcher.setImageDrawable(d);
System.out.println("Pic Set");
tv_counter.setText("" + (picNum+1) + "/5");
}
};
private final Runnable Play = new Runnable() {
public void run() {
while(!stop){
try{
Thread.sleep(3000);
handler.post(new Runnable() {
public void run() {
if(play)
NextPic();
}
});
}
catch(Exception e){
System.out.println("Play Error - " + e);
}
}
}
};
protected void NextPic(){
try{
picNum++;
if(picNum > 4)
picNum = 0;
tv_counter.setText("" + (picNum+1) + "/5");
imageSwitcher.setInAnimation(this, R.anim.slide_in_left ); // added
imageSwitcher.setOutAnimation(this, R.anim.slide_out_left); // added
Drawable d =new BitmapDrawable(bm_images[picNum]);
imageSwitcher.setImageDrawable(d);
System.out.println("Next Pic");
}
catch(Exception e){
System.out.println("Next Fail " + e);
imageSwitcher.setImageDrawable(null);
}
}
protected void PreviousPic(){
picNum--;
if(picNum < 0)
picNum = 4;
tv_counter.setText("" + (picNum+1) + "/5");
try{
imageSwitcher.setInAnimation(this, R.anim.slide_in_right ); // added
imageSwitcher.setOutAnimation(this, R.anim.slide_out_right); // added
Drawable d =new BitmapDrawable(bm_images[picNum]);
imageSwitcher.setImageDrawable(d);
System.out.println("Previous Pic");
}
catch(Exception e){
System.out.println("Previous Fail " + e);
//imageSwitcher.setImageResource(R.drawable.download_error);
imageSwitcher.setImageDrawable(null);
}
}
protected void ChangeBarVisibles(){
if(topFrame.isShown()){
topFrame.setVisibility(View.INVISIBLE);
bottomFrame.setVisibility(View.INVISIBLE);
}
else{
topFrame.setVisibility(View.VISIBLE);
bottomFrame.setVisibility(View.VISIBLE);
}
}
public View makeView()
{
ImageView imageView = new ImageView(this);
imageView.setBackgroundColor(0xFF000000);
imageView.setScaleType(ImageView.ScaleType.FIT_CENTER);
imageView.setLayoutParams(new
ImageSwitcher.LayoutParams(
LayoutParams.FILL_PARENT,
LayoutParams.FILL_PARENT));
return imageView;
}
class MyGestureDetector extends SimpleOnGestureListener {
@Override
public boolean onFling(MotionEvent e1, MotionEvent e2, float velocityX, float velocityY) {
try {
if (Math.abs(e1.getY() - e2.getY()) > SWIPE_MAX_OFF_PATH)
return false;
// right to left swipe
if(e1.getX() - e2.getX() > SWIPE_MIN_DISTANCE && Math.abs(velocityX) > SWIPE_THRESHOLD_VELOCITY) {
//Toast.makeText(SelectFilterActivity.this, "Left Swipe", Toast.LENGTH_SHORT).show();
NextPic();
//return true;
} else if (e2.getX() - e1.getX() > SWIPE_MIN_DISTANCE && Math.abs(velocityX) > SWIPE_THRESHOLD_VELOCITY) {
//Toast.makeText(SelectFilterActivity.this, "Right Swipe", Toast.LENGTH_SHORT).show();
PreviousPic();
//return true;
}
} catch (Exception e) {
// nothing
}
return true;
}
public boolean onSingleTapUp(MotionEvent e){
if(e.getAction() == MotionEvent.ACTION_UP){
ChangeBarVisibles();
}
return true;
}
}
@Override
public void onConfigurationChanged(Configuration newConfig) {
super.onConfigurationChanged(newConfig);
setContentView(R.layout.xl_06_photos);
InitView();
}
@Override
public void onStop(){
super.onStop();
System.gc();
}
}
我的成绩类(class):
public class _02_Results extends ListActivity {
private SearchParser xmlParser;
private URLQueryGenerator urlGen;
//private ProgressDialog dialog;
private Handler handler;
private CellAdapter_SearchResults adapter;
//private Thread thr_downloadImages;
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.xl_02_results);
handler = new Handler();
//thr_downloadImages = new Thread();
xmlParser = new SearchParser();
urlGen = new URLQueryGenerator(getParent());
adapter =new CellAdapter_SearchResults(_02_Results.this, AppDelegate.properties);
setListAdapter(adapter);
if(AppDelegate.properties.size() < 1){
//Reset Results page number to one. Because the results are starting afresh.
AppDelegate.pageNum = 1;
handler.post(ReloadCells);
GetResults();
}
if(AppDelegate.results_ListView_State != null)
getListView().onRestoreInstanceState(AppDelegate.results_ListView_State);
//if(AppDelegate.pick > 0)
// setSelection(AppDelegate.pick);
}
public void onResume()
{
super.onResume();
System.gc();
new Thread(LoadImages).start();
}
@Override
protected void onListItemClick(ListView l, View v, int position, long id) {
//If the last is picked and it is a Get More (Blank/Empty) Cell Download More Properties.
if(position >= AppDelegate.properties.size()-1 && AppDelegate.properties.get(position).str_ID.length() <= 0)
{
xmlParser = new SearchParser();
LoadMoreResults();
}
//Else view Property in Array
else{
Intent myIntent = new Intent(getParent(), _03_Detailed.class);
AppDelegate.pick = position;
TabGroupActivity parentActivity = (TabGroupActivity)getParent();
parentActivity.startChildActivity("Detailed_03", myIntent);
//Save the listview state for later init
AppDelegate.results_ListView_State = getListView().onSaveInstanceState();
}
}
protected void GetResults(){
//Show Progress Dialog
//dialog = ProgressDialog.show(getParent(), "", getResources().getString(R.string.search_alert), true);
Toast.makeText(getApplicationContext(), getResources().getString(R.string.search_alert), Toast.LENGTH_SHORT).show();
Runnable getResults = new Runnable() {
public void run() {
try{
//Get XML page from URL generated as a String
String xml = XMLfunctions.getXML(urlGen.createSearchURL());
if(xml == null){
handler.post(DownloadFail_Dialog);
System.out.println("xml is null");
return;
}
//Add the parsed properties return from Parser
AppDelegate.properties.addAll(xmlParser.ParserXML(xml));// xmlParser.ParserXML(urlString);
//Get the number of results for search
if(AppDelegate.numResults < 0)
AppDelegate.numResults = xmlParser.numResults;
System.out.println("Numb of Results:- " + AppDelegate.numResults);
//Add blank cell for more button
if(AppDelegate.properties.size() < xmlParser.numResults)
AppDelegate.properties.add(new Property());
//Refresh the ListView
try{handler.post(ReloadCells);}
catch(Exception e) { System.out.println(e);}
//dialog.dismiss();
if(AppDelegate.properties.size() < 1)
handler.post(NoResults_Dialog);
}
catch(Exception e){
//dialog.dismiss();
handler.post(DownloadFail_Dialog);
System.out.println(e);
}
finally{
//Dismiss Progress dialog
//dialog.dismiss();
System.gc();
new Thread(LoadImages).start();
}
}
};
new Thread(getResults).start();
}
protected void LoadMoreResults()
{
//Only proceed if more results are available
if(AppDelegate.numResults > AppDelegate.properties.size()){
Toast.makeText(getApplicationContext(), getResources().getString(R.string.search_more), Toast.LENGTH_SHORT).show();
//Show progress dialog
//dialog = ProgressDialog.show(getParent(), "", getResources().getString(R.string.loading), true);
Runnable getResults = new Runnable() {
public void run() {
try{
AppDelegate.pageNum++;
String xml = null;
//Get XML Page as a String
xml = XMLfunctions.getXML(urlGen.createSearchURL() + "&Page=" + AppDelegate.pageNum);
if(xml == null){
handler.post(DownloadFail_Dialog);
System.out.println("xml is null");
return;
}
//Add properties returned from XML Parser
AppDelegate.properties.addAll(AppDelegate.properties.size()-1, xmlParser.ParserXML(xml));// xmlParser.ParserXML(urlString);
handler.post(ReloadCells);
}
catch(Exception e){
System.out.println(e);
AppDelegate.pageNum--;
//dialog.dismiss();
}
finally{
//dialog.dismiss();
System.gc();
/*
if(thr_downloadImages.isAlive()){
thr_downloadImages.stop();
thr_downloadImages = null;
}
thr_downloadImages = new Thread(LoadImages);
thr_downloadImages.start();
*/
new Thread(LoadImages).start();
}
}
};
new Thread(getResults).start();
}
else{
handler.post(NoResults_Dialog);
}
}
/**
* **IMPORTANT**
*
* The functions below are for the activity to be accessed at any point.
* They should only be access by Handler.
*
* By using the handler, this can be accessed from inside a separate Thread other than the Main one.
* This is done because some GUI elements can not be accessed inside a Thread, other than the Main.
*
*/
private final Runnable LoadImages = new Runnable() {
public void run() {
for(int x=0; x <AppDelegate.properties.size(); x++){
try{
//Run the image download twice, because sometimes the images doesn't download the first time
if(AppDelegate.properties.get(x).img_thumb == null)
AppDelegate.properties.get(x).img_thumb = FindPropertyActivity.DownloadImage(AppDelegate.properties.get(x).str_imgURL1);
if(AppDelegate.properties.get(x).img_thumb == null)
AppDelegate.properties.get(x).img_thumb = FindPropertyActivity.DownloadImage(AppDelegate.properties.get(x).str_imgURL1);
handler.post(ReloadCells);
}
catch (Exception e) {System.out.println(e.toString());}
}
}
};
private final Runnable ReloadCells = new Runnable() {
public void run() {
adapter.UpdateDataSet(AppDelegate.properties);
adapter.notifyDataSetChanged();
}
};
private final Runnable DownloadFail_Dialog = new Runnable() {
public void run() {
AlertDialog.Builder builder = new AlertDialog.Builder(getParent());
builder.setMessage(getResources().getString(R.string.download_fail))
.setCancelable(false)
.setPositiveButton(getResources().getString(R.string.ok), new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int id) {
//do nothing
}
});
AlertDialog alert = builder.create();
alert.show();
}
};
private final Runnable NoResults_Dialog = new Runnable() {
public void run() {
AlertDialog.Builder builder = new AlertDialog.Builder(getParent());
builder.setMessage(getResources().getString(R.string.no_results))
.setCancelable(false)
.setPositiveButton(getResources().getString(R.string.ok), new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int id) {
//do nothing
}
});
AlertDialog alert = builder.create();
alert.show();
}
};
}
我没有更多的空间来粘贴另一个类:(
感谢任何帮助。
提前谢谢您!!
这是加载搜索的日志猫
09-11 13:13:47.451: I/System.out(8774): Parser Completed!! 09-11 13:13:52.541: I/System.out(8774): java.io.FileNotFoundException: http://images.ultrait.me/ImageProcessor.aspx?imageURL=381/Sales/321464/53674_T_ADDRESSES_52056_TN.jpg&Text=LET AGREED 09-11 13:13:53.431: I/System.out(8774): java.io.FileNotFoundException: http://images.ultrait.me/ImageProcessor.aspx?imageURL=381/Sales/321465/58467_T_ADDRESSES_57077_OT.jpg&Text=LET AGREED 09-11 13:13:54.031: I/System.out(8774): java.io.FileNotFoundException: http://images.ultrait.me/ImageProcessor.aspx?imageURL=381/Sales/321466/58441_T_ADDRESSES_57075_OT.jpg&Text=LET AGREED 09-11 13:13:54.651: I/System.out(8774): java.io.FileNotFoundException: http://images.ultrait.me/ImageProcessor.aspx?imageURL=381/Sales/321467/53631_T_ADDRESSES_52035_TN.jpg&Text=LET AGREED 09-11 13:13:55.801: I/System.out(8774): java.io.FileNotFoundException: http://images.ultrait.me/ImageProcessor.aspx?imageURL=381/Sales/321468/53626_T_ADDRESSES_52026_TN.jpg&Text=LET AGREED 09-11 13:13:59.591: I/System.out(8774): java.io.FileNotFoundException: http://images.ultrait.me/ImageProcessor.aspx?imageURL=381/Sales/321469/53540_T_ADDRESSES_51961_TN.jpg&Text=LET AGREED 09-11 13:14:00.001: D/PowerManagerService(182): acquireWakeLock flags=0x1 tag=AlarmManager 09-11 13:14:00.031: D/PowerManagerService(182): releaseWakeLock flags=0x1 tag=AlarmManager 09-11 13:14:02.051: I/System.out(8774): java.io.FileNotFoundException: http://images.ultrait.me/ImageProcessor.aspx?imageURL=381/Sales/321470/53659_T_ADDRESSES_52050_TN.jpg&Text=LET AGREED 09-11 13:14:03.691: I/System.out(8774): java.io.FileNotFoundException: http://images.ultrait.me/ImageProcessor.aspx?imageURL=381/Sales/321471/53611_T_ADDRESSES_52018_TN.jpg&Text=LET AGREED 09-11 13:14:04.761: I/System.out(8774): java.io.FileNotFoundException: http://images.ultrait.me/ImageProcessor.aspx?imageURL=381/Sales/321472/53589_T_ADDRESSES_51972_TN.jpg&Text=LET AGREED 09-11 13:14:05.531: I/System.out(8774): java.io.FileNotFoundException: http://images.ultrait.me/ImageProcessor.aspx?imageURL=381/Sales/321473/46397_T_ADDRESSES_43205_OT.jpg&Text=LET AGREED 09-11 13:14:05.851: I/System.out(8774): java.io.FileNotFoundException: http://images.ultrait.me/ImageProcessor.aspx?imageURL=381/Sales/321474/53664_T_ADDRESSES_52053_TN.jpg&Text=LET AGREED 09-11 13:14:06.531: I/System.out(8774): java.io.FileNotFoundException: http://images.ultrait.me/ImageProcessor.aspx?imageURL=381/Sales/321475/53669_T_ADDRESSES_52054_TN.jpg&Text=LET AGREED 09-11 13:14:08.701: I/System.out(8774): java.io.FileNotFoundException: http://images.ultrait.me/ImageProcessor.aspx?imageURL=381/Sales/321476/53651_T_ADDRESSES_52049_TN.jpg&Text=LET AGREED 09-11 13:14:09.991: I/System.out(8774): java.io.FileNotFoundException: http://images.ultrait.me/ImageProcessor.aspx?imageURL=381/Sales/321477/43296_T_ADDRESSES_40850_TN.jpg&Text=LET AGREED 09-11 13:14:11.331: I/System.out(8774): java.io.FileNotFoundException: http://images.ultrait.me/ImageProcessor.aspx?imageURL=381/Sales/321478/53944_T_ADDRESSES_52241_TN.jpg&Text=LET AGREED 09-11 13:14:11.961: I/System.out(8774): Numb of Results:- 177 09-11 13:14:12.031: I/System.out(8774): java.net.MalformedURLException: Protocol not found: 09-11 13:14:12.031: I/System.out(8774): java.lang.NullPointerException 09-11 13:14:12.031: I/System.out(8774): java.net.MalformedURLException: Protocol not found: 09-11 13:14:12.031: I/System.out(8774): java.lang.NullPointerException 09-11 13:14:12.181: I/pcm_service(107): process rmnet event 09-11 13:14:12.181: I/pcm_service(107): rstate == PCM_RMNETSTATE_ERROR in pcm_monitor_kevents 09-11 13:14:12.181: I/dun_service(115): process rmnet event 09-11 13:14:12.181: I/dun_service(115): Post event 3 09-11 13:14:12.191: I/dun_service(115): received event: DUN_EVENT_RMNET_DOWN 09-11 13:14:12.191: I/dun_service(115): received event(DUN_EVENT_RMNET_DOWN) in state(DUN_STATE_USB_UNPLUG) 09-11 13:14:12.191: I/dun_service(115): Ignoring the event DUN_EVENT_RMNET_DOWN in USB_UNPLUG_STATE 09-11 13:14:12.191: I/dun_service(115): Moved to state(DUN_STATE_USB_UNPLUG)
最佳答案
我还没有检查你的代码,但我首先想到的是:你检查过应用程序的权限吗?它可能来自那里。 (例如:没有互联网权限,找不到文件,因为它无权访问它)
编辑:您应该检查(调试或记录)此“str_imageURLs[i]”是否没有返回奇怪的内容(并且您应该删除网址中的空格)。
然后,如果有问题,我猜它来自于:“FindPropertyActivity.DownloadImage”你能发一下吗?您是否将图像作为输入流并从中形成可绘制对象(如果不是 DownloadImage 中所做的事情)?
Edit2:我创建了一个基本应用程序,布局中仅包含一个 ImageView。然后我使用你的“DownloadImage”方法从 url 获取图像,而不需要附加参数(我停在“.jg”)。它不适用于 android 4.2,因为它要求它是异步的。
我将其添加到我的主要 Activity 中,然后它起作用了:
ThreadPolicy tp = ThreadPolicy.LAX;
StrictMode.setThreadPolicy(tp);
但显然,这不是要做的事情。
问题既不是你的 URL,也不是你获取图像的方法。它在 android 4.2 上运行得很好。
你能用 Log.e("PutClassNameHere", "Put your cutom message there", throwable); 替换所有的 system.out.println*** 吗? ?这会将错误写入您的 logCat
关于java.io.FileNotFoundException :,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/18740391/
我在 VisualStudio2010 中创建了小的 Windows Forms progs,只是为了业余爱好。释放它们后,我使用 .exe 文件在其他 PC 上运行它们,而无需 进行任何安装。这些
我正在尝试使用AvroParquetWriter将Avro格式的文件转换为 Parquet 文件。我加载架构 val schema:org.apache.Schema = ... getSchema(
我正在尝试使用 Image.IO.Write() 保存图像;我基本上从 here 复制了标准代码使用 lwjgl 截取屏幕截图。我唯一做的就是使用现有目录作为保存路径来初始化文件。 当我尝试保存图像时
错误: E/BitmapFactory﹕ Unable to decode stream: java.io.FileNotFoundException: /file:/storage/sdcard0/
如果这是基本的,我很抱歉,我错过了一些简单的东西。我正在尝试运行下面的代码以遍历文件夹中的文件并将所有以特定字符串开头的文件合并到数据框中。所有文件都放在一个湖中。 file_list=[] path
在我的数据库中,我的手机上的每个条目都有一个图片的 uri。为了在手机上显示它,Listview 有一个 CustomAdapter。现在,我想在 ListView 中显示图片,得到如下错误信息: 0
我的所有节点在压缩期间都抛出 FileNotFoundException。因此,没有一个压缩(自动、手动)可以完成,我的 SSTable 计数现在是单个 CF (CQL3) 的数千个。 nodetoo
我在 java 中读取文件时遇到一些问题: 我的文件是例如: 3,4 2 6 4 1 7 3 8 9 其中第一行 3 和 4 是数组 A 和 B 的长度,然后是每个数组的元素。 我做的 import
我创建了一个程序,其中保存了学生的成绩,我想将这些成绩存储在txt文件中,然后在启动程序时,导入成绩,并在程序完成后导出成绩。我将import和exportTo方法放在单独的文件中,然后在主类中调用这
我怎样才能捕获一个 com.sun.faces.context.FacesFileNotFoundException 在 Java EE 网络应用程序中? 我尝试在我的 web.xml 文件中添加以下
请帮忙,我正在尝试从此谷歌翻译 API URL 获取数据仅当值为 1 个单词时它才有效。如果值为 2,则会出现错误。 我的意思是这个值会起作用: String sourceLang = "auto";
当我尝试使用retrofit2上传图片时,出现此错误 :java.io.FileNotFoundException(No such file or directory). HashMap partMa
try { FileReader fr = new FileReader("C:\\Users\\kevin\\Desktop\\AndroidLibr\\LeagueStats\\a
我尝试使用 Java 将单个文件从源复制到目标,但收到以下错误消息。 java.io.FileNotFoundException:以下是方法 public void copy_single(Strin
类似的问题涉及 C: 上的文件。驱动器,其中对文件路径进行硬编码是可接受的答案。此应用程序是移动应用程序,对文件路径进行硬编码并不实用。 我正在尝试通过扫描仪导入一个文本文件,其中包含一个字符串列表,
我正在修改一个小应用程序以从文件中读取一些数字。到目前为止一切都运行良好,但现在我遇到了一个问题,我不知道如何有效地解决它。如果用户输入了错误的文件名(可能是无意的),JVM 将抛出 FileNotF
我有一个 Web 项目,其中使用以下代码: try { br1 = new BufferedReader(new FileReader("queryWords.txt")); } catch
我尝试使用绝对路径从文件系统读取文件,但由于“FileNotFoundException”而失败,我不知道为什么 File file=new File("E:\\Directory\\File.txt
在我当前的项目中,我遇到了未收到文件未找到异常的问题。我的驱动程序文件将要打开的路径传递给正在构建图书库的构造函数。我正在使用 JFileChooser 来获取路径。在尝试强制错误(输入不存在的文件名
这个问题已经有答案了: Java: Unresolved compilation problem (10 个回答) 已关闭 4 年前。 我已经查看了有关此问题的其他答案,并尝试了他们的建议,但没有成功
我是一名优秀的程序员,十分优秀!