Comments (3)
The fault was in my code.
I instantiated the printSightRedcution inside a push button on click event. Since the whole printjob is asynchronous and works independent from the AstroNavigator app it was required to have this class instantiated in a class where it longer exists. The point is that the message in the Status field in the "Nautical Almanac" dialog appear before the "Printer Dialog" and preview was loaded but after that the code is at the end and the block will be destroyed. The garbage collector will clean up the instantiated object more or less fast.
That's why I moved the bold line of code out of the "setOnClickListener". Now it seems to be much more stable.
===========================Code snippet Begin
printSightRedcution = new printSightRedcution(NADataAndCalc);
pbPrintSightReductionForm.setOnClickListener(new View.OnClickListener() {
@OverRide
public void onClick(View view) {
// ToDo: Print the Sight Reduction
try {
if (NADataAndCalc!=null) {
// Moved outside the event handler printSightRedcution = new printSightRedcution(NADataAndCalc);
printSightRedcution.doWebViewPrint(getActivity());
// Function above come back before preview was shown or SRF was printed. The app run in the background.
// This change made it much more stable.
mdfStatus.setBackgroundColor(Color.WHITE);
mdfStatus.setText("Printing Sight Reduction Form");
}
else {
mdfStatus.setBackgroundColor(Color.WHITE);
mdfStatus.setText("No printable calculation");
}
}
catch (Exception e)
{
mdfStatus.setBackgroundColor(Color.RED);
mdfStatus.setText(e.getMessage());
}
}
});
===========================Code snippet End
from astronavi.
In the emulator it works perfect. Seem to be really a problem of the Epson driver. Especially under heavy CPU load this problem was seen.
from astronavi.
Additional Remark: In emulation mode this works also perfect. In my opinion just a problem of the CPU power of the cellphone.
from astronavi.
Related Issues (2)
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from astronavi.